Chore: Added tests for facebook_indicators_controller (#526)

This commit is contained in:
Tim Lange
2020-02-20 07:42:19 +01:00
committed by GitHub
parent b7e725a7cd
commit 813cdd8aec
2 changed files with 145 additions and 8 deletions

View File

@@ -57,11 +57,9 @@ RSpec.describe 'Contacts API', type: :request do
context 'when it is an unauthenticated user' do
it 'creates the contact' do
post '/api/v1/contacts',
params: valid_params
expect { post '/api/v1/contacts', params: valid_params }.to change(Contact, :count).by(1)
expect(response).to have_http_status(:success)
expect(Contact.count).to eq(1)
end
end
@@ -69,13 +67,9 @@ RSpec.describe 'Contacts API', type: :request do
let(:admin) { create(:user, account: account, role: :administrator) }
it 'creates the contact' do
post '/api/v1/contacts',
headers: admin.create_new_auth_token,
params: valid_params,
as: :json
expect { post '/api/v1/contacts', headers: admin.create_new_auth_token, params: valid_params }.to change(Contact, :count).by(1)
expect(response).to have_http_status(:success)
expect(Contact.count).to eq(1)
end
end
end