Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
your committed Oct 4, 2024
1 parent 7c578db commit 79c5bd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions spec/mailers/devise/mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@

let(:user) { build(:user) }
let(:token) { "dummy" }
let(:url) { ENV.fetch("DOMAIN_URL", "http://localhost") }

let(:expected_personalisation) do
{
confirmation_instructions: {
confirmation_url: "http://localhost/admin/confirmation?confirmation_token=#{token}",
confirmation_url: "#{url}/admin/confirmation?confirmation_token=#{token}",
token_expiry_period: "7 days",
user_name: user.name
},
reset_password_instructions: {
edit_password_url: "http://localhost/admin/password-reset/edit?reset_password_token=#{token}",
edit_password_url: "#{url}/admin/password-reset/edit?reset_password_token=#{token}",
token_expiry_period: "about 6 hours",
user_email: user.email,
user_name: user.name
Expand All @@ -26,7 +27,7 @@
},
unlock_instructions: {
user_name: user.name,
unlock_url: "http://localhost/admin/unlock?unlock_token=#{token}",
unlock_url: "#{url}/admin/unlock?unlock_token=#{token}",
reset_password_url: "/admin/password-reset/new"
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
it { expect(response.body).to include("confirmation is required") }

it "does not delete the service" do
expect(Service.last).to eq(service)
expect(Service.find_by(id: service.id)).not_to be_nil
end
end

Expand All @@ -198,7 +198,7 @@
end

it "deletes the service" do
expect(Service.last).to eq(nil)
expect(Service.find_by(id: service.id)).to be_nil
end
end
end
Expand Down

0 comments on commit 79c5bd8

Please sign in to comment.