Skip to content

Commit

Permalink
Refs #37140 - fix some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Feb 5, 2024
1 parent 8e544d5 commit ae271a9
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions test/controllers/foreman/organizations_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,10 @@ def test_use_newly_created_org
assert_equal session[:organization_id], org.id
end

def test_simple_content_access_disable
# use org with SCA enabled
org = get_organization(:organization2)
Organization.any_instance.stubs(:simple_content_access?).returns true
# assert correct task will be started
@controller.expects(:sync_task).with(::Actions::Katello::Organization::SimpleContentAccess::Disable, org.id.to_s)
# send request to disable SCA
put :update, params: { id: org.id, simple_content_access: false }
assert_response :found
end

def test_simple_content_access_enable
# use org with SCA disabled
org = get_organization(:organization2)
Organization.any_instance.stubs(:simple_content_access?).returns false
# assert correct task will be started
@controller.expects(:sync_task).with(::Actions::Katello::Organization::SimpleContentAccess::Enable, org.id.to_s)
# send request to enable SCA
put :update, params: { id: org.id, simple_content_access: true }
assert_response :found
end

def test_simple_content_access_unchanged
# use org with SCA enabled
org = get_organization(:organization2)
Organization.any_instance.stubs(:simple_content_access?).returns true
# assert SCA task was not initiated
@controller.expects(:async_task).never
# update org and don't change SCA
put :update, params: { id: org.id, simple_content_access: true }
assert_response :found
end

def test_edit_override_can_toggle
org = get_organization(:organization2)
Organization.any_instance.stubs(:service_level)
Organization.any_instance.stubs(:service_levels).returns []
Organization.any_instance.expects(:simple_content_access?).returns true
get :edit, params: { id: org.id }
assert_response :success
end
Expand Down

0 comments on commit ae271a9

Please sign in to comment.