Commit a8b655a4 authored by Marin Jankovski's avatar Marin Jankovski

Fix unsubscribe controller spec.

parent 0b9f6c58
...@@ -5,13 +5,13 @@ describe UnsubscribesController do ...@@ -5,13 +5,13 @@ describe UnsubscribesController do
describe "show" do describe "show" do
it "responds with success" do it "responds with success" do
get :show, email: CGI.escape('me@example.com') get :show, email: Base64.urlsafe_encode64('me@example.com')
assert_response :success assert_response :success
end end
it "behaves the same if email address isn't known in the system" do it "behaves the same if email address isn't known in the system" do
get :show, email: CGI.escape('i@dont_exists.com') get :show, email: Base64.urlsafe_encode64('i@dont_exists.com')
assert_response :success assert_response :success
end end
...@@ -19,14 +19,14 @@ describe UnsubscribesController do ...@@ -19,14 +19,14 @@ describe UnsubscribesController do
describe "create" do describe "create" do
it "unsubscribes the connected user" do it "unsubscribes the connected user" do
post :create, email: CGI.escape('me@example.com') post :create, email: Base64.urlsafe_encode64('me@example.com')
assert user.reload.admin_email_unsubscribed_at assert user.reload.admin_email_unsubscribed_at
end end
# Don't tell if the email does not exists # Don't tell if the email does not exists
it "behaves the same if email address isn't known in the system" do it "behaves the same if email address isn't known in the system" do
post :create, email: CGI.escape('i@dont_exists.com') post :create, email: Base64.urlsafe_encode64('i@dont_exists.com')
assert_response :redirect assert_response :redirect
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment