Facelift offline.html and use Bootstrap classes for "notifications"
Update site_controller_test.rb Update site_controller_test.rb Remove whitespace Reset Settings.status after test is done Update test for offline page Update site_controller.rb Fix indentation Update offline controller Update offline.html.erb Remove flash CSS classes and fix missed tests Updated tests Address most PR comments Update _flash.html.erb Update _flash.html.erb Update edit.html.erb Update offline.html.erb
This commit is contained in:
parent
1becffcbf5
commit
318064b2a7
12 changed files with 58 additions and 70 deletions
|
@ -60,7 +60,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
patch account_path, :params => { :user => new_attributes }
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", false
|
||||
assert_select ".alert-success", false
|
||||
assert_select "form#accountForm > div > input.is-invalid#user_display_name"
|
||||
|
||||
# Changing name to one that exists should fail, regardless of case
|
||||
|
@ -68,7 +68,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
patch account_path, :params => { :user => new_attributes }
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", false
|
||||
assert_select ".alert-success", false
|
||||
assert_select "form#accountForm > div > input.is-invalid#user_display_name"
|
||||
|
||||
# Changing name to one that doesn't exist should work
|
||||
|
@ -79,7 +79,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
get edit_account_path
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", /^User information updated successfully/
|
||||
assert_select ".alert-success", /^User information updated successfully/
|
||||
assert_select "form#accountForm > div > input#user_display_name[value=?]", "new tester"
|
||||
|
||||
# Record the change of name
|
||||
|
@ -94,7 +94,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", false
|
||||
assert_select ".alert-success", false
|
||||
assert_select "form#accountForm > div > input.is-invalid#user_new_email"
|
||||
|
||||
# Changing email to one that exists should fail, regardless of case
|
||||
|
@ -106,7 +106,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", false
|
||||
assert_select ".alert-success", false
|
||||
assert_select "form#accountForm > div > input.is-invalid#user_new_email"
|
||||
|
||||
# Changing email to one that doesn't exist should work
|
||||
|
@ -121,7 +121,7 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|||
get edit_account_path
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", /^User information updated successfully/
|
||||
assert_select ".alert-success", /^User information updated successfully/
|
||||
assert_select "form#accountForm > div > input#user_new_email[value=?]", user.new_email
|
||||
email = ActionMailer::Base.deliveries.first
|
||||
assert_equal 1, email.to.count
|
||||
|
|
|
@ -220,7 +220,7 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest
|
|||
:message => { :title => "Test Message", :body => "Test message body" })
|
||||
assert_response :success
|
||||
assert_template "new"
|
||||
assert_select ".error", /wait a while/
|
||||
assert_select ".alert.alert-danger", /wait a while/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -81,7 +81,7 @@ class PasswordsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
assert_response :success
|
||||
assert_template :lost_password
|
||||
assert_select ".error", /^Could not find that email address/
|
||||
assert_select ".alert.alert-danger", /^Could not find that email address/
|
||||
|
||||
# Test resetting using the address as recorded for a user that has an
|
||||
# address which is case insensitively unique
|
||||
|
|
|
@ -29,8 +29,8 @@ class PreferencesControllerTest < ActionDispatch::IntegrationTest
|
|||
put preferences_path, :params => { :user => user.attributes }
|
||||
assert_response :success
|
||||
assert_template :edit
|
||||
assert_select ".notice", false
|
||||
assert_select ".error", true
|
||||
assert_select ".alert-success", false
|
||||
assert_select ".alert-danger", true
|
||||
assert_select "form > div > select#user_preferred_editor > option[selected]", false
|
||||
|
||||
# Changing to a valid editor should work
|
||||
|
@ -40,7 +40,7 @@ class PreferencesControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_redirected_to preferences_path
|
||||
follow_redirect!
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Preferences updated/
|
||||
assert_select ".alert-success", /^Preferences updated/
|
||||
assert_select "dd", "iD (in-browser editor)"
|
||||
|
||||
# Changing to the default editor should work
|
||||
|
@ -50,7 +50,7 @@ class PreferencesControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_redirected_to preferences_path
|
||||
follow_redirect!
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Preferences updated/
|
||||
assert_select ".alert-success", /^Preferences updated/
|
||||
assert_select "dd", "Default (currently iD)"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
|
|||
follow_redirect!
|
||||
assert_response :success
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Profile updated./
|
||||
assert_select ".alert-success", /^Profile updated./
|
||||
assert_select "div", "new description"
|
||||
|
||||
# Changing to an uploaded image should work
|
||||
|
@ -37,7 +37,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
|
|||
follow_redirect!
|
||||
assert_response :success
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Profile updated./
|
||||
assert_select ".alert-success", /^Profile updated./
|
||||
get edit_profile_path
|
||||
assert_select "form > fieldset > div > div.col-sm-10 > div.form-check > input[name=avatar_action][checked][value=?]", "keep"
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
|
|||
follow_redirect!
|
||||
assert_response :success
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Profile updated./
|
||||
assert_select ".alert-success", /^Profile updated./
|
||||
get edit_profile_path
|
||||
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked][value=?]", "gravatar"
|
||||
|
||||
|
@ -59,7 +59,7 @@ class ProfilesControllerTest < ActionDispatch::IntegrationTest
|
|||
follow_redirect!
|
||||
assert_response :success
|
||||
assert_template :show
|
||||
assert_select ".notice", /^Profile updated./
|
||||
assert_select ".alert-success", /^Profile updated./
|
||||
get edit_profile_path
|
||||
assert_select "form > fieldset > div > div.col-sm-10 > div > input[name=avatar_action][checked]", false
|
||||
assert_select "form > fieldset > div > div.col-sm-10 > div > div.form-check > input[name=avatar_action][checked]", false
|
||||
|
|
|
@ -495,7 +495,7 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
|
|||
def test_offline
|
||||
get offline_path
|
||||
assert_response :success
|
||||
assert_template "offline"
|
||||
assert_select ".alert-warning"
|
||||
end
|
||||
|
||||
# Test the rich text preview
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue