|
|
|
@ -13,6 +13,7 @@ RSpec.describe Api::SalmonController, type: :controller do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
describe 'POST #update' do
|
|
|
|
|
context 'with valid post data' do
|
|
|
|
|
before do
|
|
|
|
|
request.env['RAW_POST_DATA'] = File.read(File.join(Rails.root, 'spec', 'fixtures', 'salmon', 'mention.xml'))
|
|
|
|
|
post :update, params: { id: account.id }
|
|
|
|
@ -38,4 +39,16 @@ RSpec.describe Api::SalmonController, type: :controller do
|
|
|
|
|
expect(account.mentions.count).to eq 1
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'with invalid post data' do
|
|
|
|
|
before do
|
|
|
|
|
request.env['RAW_POST_DATA'] = ''
|
|
|
|
|
post :update, params: { id: account.id }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'returns http success' do
|
|
|
|
|
expect(response).to have_http_status(202)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|