Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Oct 2, 2024
1 parent 58cdaf7 commit 04cf9a2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion spec/shared/filterable_login_code_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
table = find("table.stack.table-list")
first_school = table.find("tbody").all("tr")[0].find("td:nth-child(3)").text
fill_in "q[creator_name_cont]", with: first_school
click_button("Search")
find('button[aria-label="Search"]').click
rows = table.find("tbody").all("tr")
rows.each do |row|
school = row.find("td:nth-child(3)")
Expand Down
4 changes: 2 additions & 2 deletions spec/system/admin/verification_code_generation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "spec_helper"

describe "verificqation code generation", type: :system do
describe "verification code generation", type: :system do
include_context "with helsinki_smsauth_id authorization"

let!(:admin) { create(:user, :admin, :confirmed, organization: organization) }
Expand All @@ -16,7 +16,7 @@
end

it "renders authorizations views" do
within ".secondary-nav" do
within "#admin-sidebar-menu-settings" do
expect(page).to have_link("Login via text message")
end

Expand Down
1 change: 0 additions & 1 deletion spec/system/log_in_with_access_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
signin_code_set.reload
expect(signin_code_set.used_code_amount).to eq(1)

expect(page).to have_current_path("/authorizations")
authorization = Decidim::Authorization.last
expect(authorization.metadata["school"]).to eq(signin_code_set.metadata["school"])
expect(authorization.metadata["grade"]).to eq(signin_code_set.metadata["grade"])
Expand Down
4 changes: 2 additions & 2 deletions spec/system/log_in_with_phone_number_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

it "authenticate and redirects the user" do
verify_phone
expect(page).to have_current_path("/authorizations")
expect(page).to have_current_path("/")
end
end

Expand All @@ -50,7 +50,7 @@

fill_in "Grade", with: 1
click_button "Save and continue"
expect(page).to have_current_path decidim_verifications.authorizations_path
expect(page).to have_current_path decidim.root_path
user = Decidim::User.last
expect(user.phone_number).to eq("+3584551122334")
authorization = Decidim::Authorization.last
Expand Down
2 changes: 1 addition & 1 deletion spec/system/verification_with_access_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
expect(authorization.metadata["school"]).to eq(school)
expect(page).to have_current_path("/authorizations")
within_flash_messages do
expect(page).to have_content("Congratulations. You've been successfully verified.")
expect(page).to have_content("Congratulations. You have been successfully verified.")
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/system/verification_with_phone_number_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
end

it "shows the available authorizations" do
within "#user-settings-tabs" do
within "#dropdown-menu-profile" do
expect(page).to have_css("a", text: "Authorizations")
end
click_link "Authorization"
expect(page).to have_content "Participant settings - Authorizations"
within ".card--list__item" do
expect(page).to have_css("svg.icon--lock-unlocked", count: 1)
within ".verification__container" do
expect(page).to have_css("svg.verification__icon", count: 1)
end
end
end
Expand All @@ -41,7 +41,7 @@
sign_in user, scope: :user
visit decidim.account_path
click_link "Authorization"
find(".card--list__item").click
click_on "Login via text message"
end

context "when authorization belongs to someone else" do
Expand Down Expand Up @@ -85,7 +85,7 @@
it "generates the authorization process" do
expect(page).to have_current_path("/helsinki_smsauth_id/authorizations/edit")
within_flash_messages do
expect(page).to have_content "Thanks! We've sent an SMS to your phone."
expect(page).to have_content "Thanks! We have sent an SMS to your phone."
end

expect(page).to have_link("Resend the code", href: "/helsinki_smsauth_id/authorizations/resend_code")
Expand All @@ -105,7 +105,7 @@
expect(authorization).not_to be_granted
expect(page).to have_current_path("/helsinki_smsauth_id/authorizations/school_info")
visit "/authorizations"
expect(page).to have_css('svg[aria-label="Pending verification"]')
expect(page).to have_css("section.authorizations-list > div.verification__container-title", text: "PENDING VERIFICATION")
end

context "when adding school info" do
Expand Down

0 comments on commit 04cf9a2

Please sign in to comment.