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

Merge branch 'fix-rspec-tests' into 'master'

fix contacts test and change language tests authentication context

See merge request portalmec/portalmec!475
parents c1f4322b 9e85291c
No related branches found
No related tags found
No related merge requests found
...@@ -47,10 +47,9 @@ resource 'Contacts' do ...@@ -47,10 +47,9 @@ resource 'Contacts' do
post '/v1/contacts' do post '/v1/contacts' do
parameter :name, 'The name of the contact', scope: :contact parameter :name, 'The name of the contact', scope: :contact
parameter :link, 'The email of the contact', scope: :contact parameter :email, 'The email of the contact', scope: :contact
parameter :description, 'The message of the contact', scope: :contact parameter :message, 'The message of the contact', scope: :contact
let(:id) { contacts.first.id }
let(:name) { Faker::Name.name } let(:name) { Faker::Name.name }
let(:email) { Faker::Internet.email } let(:email) { Faker::Internet.email }
let(:message) { Faker::Lorem.sentence } let(:message) { Faker::Lorem.sentence }
...@@ -64,8 +63,8 @@ resource 'Contacts' do ...@@ -64,8 +63,8 @@ resource 'Contacts' do
put '/v1/contacts/:id' do put '/v1/contacts/:id' do
parameter :name, 'The name of the contact', scope: :contact parameter :name, 'The name of the contact', scope: :contact
parameter :link, 'The email of the contact', scope: :contact parameter :email, 'The email of the contact', scope: :contact
parameter :description, 'The message of the contact', scope: :contact parameter :message, 'The message of the contact', scope: :contact
let(:id) { contacts.first.id } let(:id) { contacts.first.id }
let(:name) { Faker::Name.name } let(:name) { Faker::Name.name }
......
...@@ -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 'Languages' do resource 'Languages' do
header 'Accept', 'application/json' header 'Accept', 'application/json'
...@@ -53,12 +54,12 @@ resource 'Languages' do ...@@ -53,12 +54,12 @@ resource 'Languages' do
end end
post '/v1/languages' do post '/v1/languages' do
include_context "authenticate_user" include_context "authenticate_user_admin"
parameter :name, 'The name of the language', scope: :language parameter :name, 'The name of the language', scope: :language
parameter :code, 'The code of the language', scope: :language parameter :code, 'The code of the language', scope: :language
let(:name) { Faker::Lorem::word } let(:name) { Faker::Lorem::word }
let(:code) { Faker::Address.country_code } let(:code) { Faker::Address.country_code }
let(:raw_post) { params.to_json } let(:raw_post) { params.to_json }
...@@ -71,7 +72,7 @@ resource 'Languages' do ...@@ -71,7 +72,7 @@ resource 'Languages' do
end end
put '/v1/languages/:id' do put '/v1/languages/:id' do
include_context "authenticate_user" include_context "authenticate_user_admin"
parameter :id, 'The id of the institution' parameter :id, 'The id of the institution'
parameter :name, 'The name of the language', scope: :language parameter :name, 'The name of the language', scope: :language
...@@ -89,7 +90,7 @@ resource 'Languages' do ...@@ -89,7 +90,7 @@ resource 'Languages' do
end end
delete '/v1/languages/:id' do delete '/v1/languages/:id' do
include_context "authenticate_user" include_context "authenticate_user_admin"
parameter :id, 'The id of the language' parameter :id, 'The id of the language'
......
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