Skip to content
Snippets Groups Projects
Commit 4966070c authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

fix rspec contacts tests for new policies

parent 4e777262
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>. # along with portalmec. If not, see <http://www.gnu.org/licenses/>.
require 'acceptance_helpers' require 'acceptance_helpers'
require 'shared/contexts'
resource 'Contacts' do resource 'Contacts' do
...@@ -28,6 +29,7 @@ resource 'Contacts' do ...@@ -28,6 +29,7 @@ resource 'Contacts' do
let(:contacts) { Contact.all } let(:contacts) { Contact.all }
get '/v1/contacts' do get '/v1/contacts' do
include_context "authenticate_user_editor"
example_request 'Getting all contacts' do example_request 'Getting all contacts' do
expect(status).to eq(200) expect(status).to eq(200)
...@@ -35,6 +37,7 @@ resource 'Contacts' do ...@@ -35,6 +37,7 @@ resource 'Contacts' do
end end
get '/v1/contacts/:id' do get '/v1/contacts/:id' do
include_context "authenticate_user_editor"
let(:id) { contacts.first.id } let(:id) { contacts.first.id }
...@@ -61,6 +64,7 @@ resource 'Contacts' do ...@@ -61,6 +64,7 @@ resource 'Contacts' do
end end
put '/v1/contacts/:id' do put '/v1/contacts/:id' do
include_context "authenticate_user_editor"
parameter :name, 'The name of the contact', scope: :contact parameter :name, 'The name of the contact', scope: :contact
parameter :email, 'The email of the contact', scope: :contact parameter :email, 'The email of the contact', scope: :contact
...@@ -78,6 +82,7 @@ resource 'Contacts' do ...@@ -78,6 +82,7 @@ resource 'Contacts' do
end end
delete '/v1/contacts/:id' do delete '/v1/contacts/:id' do
include_context "authenticate_user_editor"
let(:id) { contacts.first.id } let(:id) { contacts.first.id }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment