Skip to content
Snippets Groups Projects
Commit 1fe387e9 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

Added test for update without authenticated

parent f2283133
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ class Score < ActiveRecord::Base
has_many :score_user_categories
has_many :user_categories, through: :score_user_categories
validates_presence_of :name, :code, :weight
validates_presence_of :name, :code, :weight, :active
validates_uniqueness_of :code
validates_numericality_of :weight
......
......@@ -19,6 +19,16 @@ class V1::ScoresControllerTest < ActionController::TestCase
assert_response :ok
end
test 'do not should put score to update if user is not authenticated and then return :unauthorized code' do
score = scores(:score_19)
put :update, score: {name: 'testing',
weight: 10,
active: true,
score_type: ['LearningObject']
}, id: score.id
assert_response :unauthorized
end
test 'should put invalid score to update and return :unprocessable_entity code' do
auth_request users(:jack)
score = scores(:score_19)
......
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