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

fix contacts test and change language tests authentication context

parent c1f4322b
No related branches found
No related tags found
No related merge requests found
......@@ -47,10 +47,9 @@ resource 'Contacts' do
post '/v1/contacts' do
parameter :name, 'The name of the contact', scope: :contact
parameter :link, 'The email of the contact', scope: :contact
parameter :description, 'The message of the contact', scope: :contact
parameter :email, 'The email 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(:email) { Faker::Internet.email }
let(:message) { Faker::Lorem.sentence }
......@@ -64,8 +63,8 @@ resource 'Contacts' do
put '/v1/contacts/:id' do
parameter :name, 'The name of the contact', scope: :contact
parameter :link, 'The email of the contact', scope: :contact
parameter :description, 'The message of the contact', scope: :contact
parameter :email, 'The email of the contact', scope: :contact
parameter :message, 'The message of the contact', scope: :contact
let(:id) { contacts.first.id }
let(:name) { Faker::Name.name }
......
......@@ -18,6 +18,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>.
require 'acceptance_helpers'
require 'shared/contexts'
resource 'Languages' do
header 'Accept', 'application/json'
......@@ -53,12 +54,12 @@ resource 'Languages' do
end
post '/v1/languages' do
include_context "authenticate_user"
include_context "authenticate_user_admin"
parameter :name, 'The name of the language', scope: :language
parameter :code, 'The code of the language', scope: :language
let(:name) { Faker::Lorem::word }
let(:code) { Faker::Address.country_code }
let(:raw_post) { params.to_json }
......@@ -71,7 +72,7 @@ resource 'Languages' do
end
put '/v1/languages/:id' do
include_context "authenticate_user"
include_context "authenticate_user_admin"
parameter :id, 'The id of the institution'
parameter :name, 'The name of the language', scope: :language
......@@ -89,7 +90,7 @@ resource 'Languages' do
end
delete '/v1/languages/:id' do
include_context "authenticate_user"
include_context "authenticate_user_admin"
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