Skip to content

Commit

Permalink
fix tests by including authorization step
Browse files Browse the repository at this point in the history
  • Loading branch information
Vakmeth committed Mar 13, 2024
1 parent 2892759 commit 23a0ac6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/controllers/skills_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

describe SkillsController do
describe 'Update Skill' do
before(:each) do
sign_in(auth_users(:admin))
end
render_views

let(:edited_skill) { {"id" => skills(:rails).id, "category_parent" => categories('system-engineering').id,
"title" => "UpdatedSkill", "radar" => "adopt", "portfolio" => "passiv", "default_set" => false,
"category_id" => categories(:ruby).id} }
Expand Down
5 changes: 5 additions & 0 deletions spec/features/skills_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require 'rails_helper'

describe :skills do
before(:each) do
admin = auth_users(:admin)
login_as(admin, scope: :auth_user)
end

def fill_out_form
fill_in 'skill_title', with: 'new Title'
select 'System-Engineering', from: 'skill_category_parent'
Expand Down
2 changes: 2 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
config.include(JsonAssertion, type: :controller)
config.include(ControllerHelpers, type: :controller)
config.include(Devise::Test::IntegrationHelpers, type: :feature)
config.include(Devise::Test::IntegrationHelpers, type: :controller)
config.include(Devise::Test::ControllerHelpers, type: :controller)

config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
Expand Down

0 comments on commit 23a0ac6

Please sign in to comment.