Commit e0ca65c5 authored by Mike Greiling's avatar Mike Greiling

add accept_confirm around attempts to revoke personal access tokens

parent 5a0e41a5
...@@ -78,7 +78,7 @@ describe 'Profile > Personal Access Tokens', :js do ...@@ -78,7 +78,7 @@ describe 'Profile > Personal Access Tokens', :js do
it "allows revocation of an active token" do it "allows revocation of an active token" do
visit profile_personal_access_tokens_path visit profile_personal_access_tokens_path
click_on "Revoke" accept_confirm { click_on "Revoke" }
expect(page).to have_selector(".settings-message") expect(page).to have_selector(".settings-message")
expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.") expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.")
...@@ -100,7 +100,7 @@ describe 'Profile > Personal Access Tokens', :js do ...@@ -100,7 +100,7 @@ describe 'Profile > Personal Access Tokens', :js do
errors = ActiveModel::Errors.new(PersonalAccessToken.new).tap { |e| e.add(:name, "cannot be nil") } errors = ActiveModel::Errors.new(PersonalAccessToken.new).tap { |e| e.add(:name, "cannot be nil") }
allow_any_instance_of(PersonalAccessToken).to receive(:errors).and_return(errors) allow_any_instance_of(PersonalAccessToken).to receive(:errors).and_return(errors)
click_on "Revoke" accept_confirm { click_on "Revoke" }
expect(active_personal_access_tokens).to have_text(personal_access_token.name) expect(active_personal_access_tokens).to have_text(personal_access_token.name)
expect(page).to have_content("Could not revoke") expect(page).to have_content("Could not revoke")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment