Skip to content

Commit

Permalink
Fix cop violations
Browse files Browse the repository at this point in the history
  • Loading branch information
murny committed Jun 17, 2024
1 parent 5a99610 commit d9b7795
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions test/integration/profiles_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,55 @@ class ProfilesTest < ActionDispatch::IntegrationTest

test "should get index" do
get profiles_url

assert_response :success
end

test "should get show" do
get profile_url(profiles(:one))

assert_response :success
end

test "should get new" do
get new_profile_url,
headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password) }
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)}

assert_response :success
end

test "should get edit" do
get edit_profile_url(profiles(:one)),
headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password) }
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)}

assert_response :success
end

test "should create profile" do
assert_difference('Profile.count') do
assert_difference("Profile.count") do
post profiles_url,
params: { profile: { first_name: "John", last_name: "Doe", email: "[email protected]" } },
headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password) }
params: {profile: {first_name: "John", last_name: "Doe", email: "[email protected]"}},
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)}
end

assert_redirected_to profile_url(Profile.last)
end

test "should update profile" do
patch profile_url(@profile),
params: { profile: { first_name: "John" } },
headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password) }
params: {profile: {first_name: "John"}},
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)}

@profile.reload

assert_redirected_to profile_url(@profile)
assert_equal "John", @profile.first_name
end

test "should destroy profile" do
assert_difference('Profile.count', -1) do
assert_difference("Profile.count", -1) do
delete profile_url(@profile),
headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password) }
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)}
end

assert_redirected_to profiles_url
Expand Down

0 comments on commit d9b7795

Please sign in to comment.