Browse Source

Remove default you need to sign in or sign up message

pull/119/head
baarkerlounger 4 years ago
parent
commit
5f1167f5da
  1. 4
      app/helpers/devise_helper.rb
  2. 5
      spec/features/user_spec.rb

4
app/helpers/devise_helper.rb

@ -1,7 +1,9 @@
module DeviseHelper
def flash_to_model_errors(resource)
if flash.alert
resource.errors.add :base, flash.alert
if flash.alert != I18n.t("devise.failure.unauthenticated")
resource.errors.add :base, flash.alert
end
flash.discard
end
end

5
spec/features/user_spec.rb

@ -7,6 +7,11 @@ RSpec.describe "User Features" do
expect(page).to have_current_path("/users/sign_in")
end
it "does not see the default devise error message" do
visit("/case_logs")
expect(page).to have_no_content("You need to sign in or sign up before continuing.")
end
it " is redirected to case logs after signing in" do
visit("/case_logs")
fill_in("user[email]", with: user.email)

Loading…
Cancel
Save