Skip to content

Commit

Permalink
Update system tests to use MFA
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed Dec 16, 2024
1 parent 1db9280 commit c82b38b
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 9 deletions.
9 changes: 6 additions & 3 deletions spec/system/admin/invitation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ def encode_token(**args)

it "creates an invitation" do
admin = create(:admin)
visit "/admin"
visit "/admin/admin_users/new"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

visit "/admin/admin_users/new"
fill_in "Token", with: admin.otp.now
click_on "Next"

fill_in "Email", with: "[email protected]"
fill_in "Name", with: "John Doe"
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/filtering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"

%i[first second third].map do |n|
create(:post, name: n, title: n.to_s.titleize)
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/ordinal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"

%i[first second third].each_with_index do |n, i|
create(:banner, name: n, ordinal: i)
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/pagination_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"
end

context "when there are more than 20 results" do
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/redirect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"
end

it "can redirect to index via turbo" do
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/sorting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"

%i[first second third].map do |n|
create(:post, name: n, title: n.to_s.titleize)
Expand Down
7 changes: 6 additions & 1 deletion spec/system/index/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
visit "/admin"

fill_in "Email", with: admin.email
click_on "Next"

fill_in "Password", with: admin.password
click_on "Log in"
click_on "Next"

fill_in "Token", with: admin.otp.now
click_on "Next"
end

it "renders a table" do
Expand Down

0 comments on commit c82b38b

Please sign in to comment.