|
17 | 17 | } |
18 | 18 | end |
19 | 19 |
|
| 20 | + describe 'PRIVATE_TYPE' do |
| 21 | + subject { described_class::PRIVATE_TYPE } |
| 22 | + it { is_expected.to eq('private') } |
| 23 | + it { is_expected.to be_frozen } |
| 24 | + end |
| 25 | + |
| 26 | + describe 'STREAM_TYPE' do |
| 27 | + subject { described_class::STREAM_TYPE } |
| 28 | + it { is_expected.to eq('stream') } |
| 29 | + it { is_expected.to be_frozen } |
| 30 | + end |
| 31 | + |
20 | 32 | describe '#[]' do |
21 | 33 | subject { message[:foo] } |
22 | 34 | it { is_expected.to eq('bar') } |
|
42 | 54 | it { is_expected.to eq(params.transform_keys(&:to_sym)) } |
43 | 55 | end |
44 | 56 |
|
| 57 | + describe '#private?' do |
| 58 | + subject { message.private? } |
| 59 | + |
| 60 | + context 'with a private message' do |
| 61 | + before { params['type'] = described_class::PRIVATE_TYPE } |
| 62 | + it { is_expected.to eq(true) } |
| 63 | + end |
| 64 | + |
| 65 | + context 'with a stream message' do |
| 66 | + before { params['type'] = described_class::STREAM_TYPE } |
| 67 | + it { is_expected.to eq(false) } |
| 68 | + end |
| 69 | + end |
| 70 | + |
| 71 | + describe '#stream?' do |
| 72 | + subject { message.stream? } |
| 73 | + |
| 74 | + context 'with a stream message' do |
| 75 | + before { params['type'] = described_class::STREAM_TYPE } |
| 76 | + it { is_expected.to eq(true) } |
| 77 | + end |
| 78 | + |
| 79 | + context 'with a private message' do |
| 80 | + before { params['type'] = described_class::PRIVATE_TYPE } |
| 81 | + it { is_expected.to eq(false) } |
| 82 | + end |
| 83 | + end |
| 84 | + |
45 | 85 | describe '#to' do |
46 | 86 | subject { message.to } |
47 | 87 | it { is_expected.to eq('social') } |
|
0 commit comments