|
23 | 23 | end |
24 | 24 | it 'registers a team' do |
25 | 25 | expect do |
26 | | - visit '/?code=code' |
| 26 | + visit '/?v1&code=code' |
27 | 27 | expect(page.find('#messages')).to have_content 'Team successfully registered!' |
28 | 28 | end.to change(Team, :count).by(1) |
29 | 29 | end |
30 | 30 | it 'includes optional parameter' do |
31 | 31 | expect(SlackRubyBotServer::Service.instance).to receive(:create!).with(instance_of(Team), state: 'property') |
32 | | - visit '/?code=code&state=property' |
| 32 | + visit '/?v1&code=code&state=property' |
33 | 33 | end |
34 | 34 | end |
35 | 35 | context 'homepage' do |
36 | 36 | before do |
37 | 37 | visit '/?v1' |
38 | 38 | end |
39 | | - it 'displays index.html page' do |
40 | | - expect(title).to eq('Slack Ruby Bot Server') |
41 | | - end |
42 | 39 | it 'includes a link to add to slack with the client id' do |
| 40 | + expect(title).to eq('Slack Ruby Bot Server') |
43 | 41 | expect(find("a[href='https://slack.com/oauth/authorize?scope=channels:read+channels:write&client_id=client_id")) |
44 | 42 | end |
45 | 43 | end |
|
55 | 53 | end |
56 | 54 | it 'registers a team' do |
57 | 55 | expect do |
58 | | - visit '/?code=code' |
| 56 | + visit '/?v2&code=code' |
59 | 57 | expect(page.find('#messages')).to have_content 'Team successfully registered!' |
60 | 58 | end.to change(Team, :count).by(1) |
61 | 59 | end |
62 | 60 | it 'includes optional parameter' do |
63 | 61 | expect(SlackRubyBotServer::Service.instance).to receive(:create!).with(instance_of(Team), state: 'property') |
64 | | - visit '/?code=code&state=property' |
| 62 | + visit '/?v2&code=code&state=property' |
65 | 63 | end |
66 | 64 | end |
67 | 65 | context 'homepage' do |
68 | 66 | before do |
69 | 67 | visit '/?v2' |
70 | 68 | end |
71 | | - it 'displays index.html page' do |
| 69 | + it 'includes a link to add to slack with the client id' do |
72 | 70 | expect(title).to eq('Slack Ruby Bot Server') |
73 | | - end |
74 | | - context 'oauth' do |
75 | | - it 'includes a link to add to slack with the client id' do |
76 | | - expect(find("a[href='https://slack.com/oauth/v2/authorize?scope=channels:read+channels:write&client_id=client_id")) |
77 | | - end |
| 71 | + expect(find("a[href='https://slack.com/oauth/v2/authorize?scope=channels:read+channels:write&client_id=client_id")) |
78 | 72 | end |
79 | 73 | end |
80 | 74 | end |
|
0 commit comments