-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deletes unused icheck from layouts/devise and deletes icheck.min.js * Prevents users from closing the modal warning by clicking outside of it or pressing the esc key in order to direct their attention to the reminder itself; users can only select the continue button after checking the checkbox; Adds bold, red text and yellow buttons as warning cues; Rewords the warning for non-tech-savvy users; Changes background to a repeated watermark image to visually differentiate from diaper.app; Changes conditional in new.html.erb and devise.html.erb to check for Rails.env.stating * changes modal id from exampleModal to warningModal; Moves the modal and corresponding JS logic to devise.html.erb so that it works on both the login and pw reset page; Moves custom styles to app/assets/stylesheets/custom.scss; Rewords from safely sign in to if you meant; Removes Safely Sign In btn; Adds minor spacing fixes to code comments * Adds background image asset for login and pw reset pages * changes condition check to Rails.env.staging in devise.html.erb file * working on Capybara test to check for modal on staging env * adds Capybara tests to check for modal/no modal in login and pw reset pages when in staging env * Update app/views/layouts/devise.html.erb Co-authored-by: Edwin Mak <[email protected]> * adds Edwins refactor to the capybara test * Change digest setting in development Co-authored-by: Edwin Mak <[email protected]>
- Loading branch information
1 parent
c2d042e
commit f9994b2
Showing
7 changed files
with
103 additions
and
64 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,33 @@ | |
fill_in "user_email", with: "[email protected]" | ||
fill_in "user_password", with: "password" | ||
find('input[name="commit"]').click | ||
|
||
expect(page).to have_content("Invalid Email or password") | ||
end | ||
end | ||
end | ||
|
||
describe 'Showing the modal warning in staging' do | ||
["/users/sign_in", "/users/password/new"].each do |path| | ||
context "when accessing #{path} in the staging environment" do | ||
before do | ||
allow(Rails.env).to receive(:staging?).and_return(true) | ||
visit path | ||
end | ||
|
||
it 'should render the modal' do | ||
expect(page).to have_content 'This site is for TEST purposes only!' | ||
end | ||
end | ||
|
||
context "when accessing #{path} not in the staging environment" do | ||
before do | ||
allow(Rails.env).to receive(:staging?).and_return(false) | ||
visit path | ||
end | ||
|
||
it 'should not render the modal' do | ||
page.assert_no_selector('#warningModal') | ||
end | ||
end | ||
end | ||
end | ||
end |