correct spec

This commit is contained in:
Sam 2018-01-12 15:05:57 +11:00
parent 3069124273
commit ec216e69c5
1 changed files with 5 additions and 5 deletions

View File

@ -48,8 +48,8 @@ describe 'Slack Command Controller', type: :request do
describe 'when the token is invalid' do describe 'when the token is invalid' do
it 'should raise the right error' do it 'should raise the right error' do
expect { post '/chat-integration/slack/command.json', params: { text: 'help' } } post '/chat-integration/slack/command.json', params: { text: 'help' }
.to raise_error(ActionController::ParameterMissing) expect(response.status).to eq(400)
end end
end end
@ -195,8 +195,8 @@ describe 'Slack Command Controller', type: :request do
context "with valid slack responses" do context "with valid slack responses" do
before do before do
stub1 = stub_request(:post, "https://slack.com/api/users.list").to_return(body: '{"ok":true,"members":[{"id":"U5Z773QLS","name":"david","profile":{"icon_24":"https://example.com/avatar"}}]}') stub_request(:post, "https://slack.com/api/users.list").to_return(body: '{"ok":true,"members":[{"id":"U5Z773QLS","name":"david","profile":{"icon_24":"https://example.com/avatar"}}]}')
stub2 = stub_request(:post, "https://slack.com/api/channels.history").to_return(body: { ok: true, messages: messages_fixture }.to_json) stub_request(:post, "https://slack.com/api/channels.history").to_return(body: { ok: true, messages: messages_fixture }.to_json)
end end
it 'generates the transcript UI properly' do it 'generates the transcript UI properly' do
@ -265,7 +265,7 @@ describe 'Slack Command Controller', type: :request do
end end
it 'deals with failed API calls correctly' do it 'deals with failed API calls correctly' do
stub1 = stub_request(:post, "https://slack.com/api/users.list").to_return(status: 403) stub_request(:post, "https://slack.com/api/users.list").to_return(status: 403)
post "/chat-integration/slack/command.json", params: { post "/chat-integration/slack/command.json", params: {
text: "post 2", text: "post 2",