-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Fenner
committed
Jan 3, 2020
1 parent
745a967
commit 0cd3214
Showing
10 changed files
with
22 additions
and
24 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
describe "Mailable", type: :model, vcr: true do | ||
let(:token) { User.generate_token } | ||
let(:client) { create(:client, name: "DATACITE.DATACITE", contact_email: "[email protected]") } | ||
let(:client) { create(:client, name: "DATACITE.DATACITE", system_email: "[email protected]") } | ||
let(:title) { "DataCite Fabrica" } | ||
|
||
it "send_welcome_email" do | ||
|
@@ -13,14 +13,14 @@ | |
|
||
# it "format_message_text" do | ||
# template = "users/reset.text.erb" | ||
# text = User.format_message_text(template: template, title: title, contact_name: client.name, name: client.symbol, url: token) | ||
# text = User.format_message_text(template: template, title: title, system_email: client.name, name: client.symbol, url: token) | ||
# line = text.split("\n").first | ||
# expect(line).to eq("Dear #{client.name},") | ||
# end | ||
|
||
# it "format_message_html" do | ||
# template = "users/reset.html.erb" | ||
# html = User.format_message_html(template: template, title: title, contact_name: client.name, name: client.symbol, url: token) | ||
# html = User.format_message_html(template: template, title: title, system_email: client.name, name: client.symbol, url: token) | ||
# line = html.split("\n")[41] | ||
# expect(line.strip).to eq("<h1 style=\"font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; box-sizing: border-box; margin-top: 0; color: #2F3133; font-size: 19px; font-weight: bold;\" align=\"left\">Dear #{client.name},</h1>") | ||
# end | ||
|
@@ -42,14 +42,14 @@ | |
DataCite Support | ||
BODY | ||
subj = title + ": Password Reset Request" | ||
response = User.send_message(name: client.name, email: client.contact_email, subject: subj, text: text) | ||
response = User.send_message(name: client.name, email: client.system_email, subject: subj, text: text) | ||
expect(response[:status]).to eq(200) | ||
expect(response[:message]).to eq("Queued. Thank you.") | ||
end | ||
|
||
context "send_notification_to_slack" do | ||
it "succeeds" do | ||
text = "Using contact email #{client.contact_email}." | ||
text = "Using contact email #{client.system_email}." | ||
options = { title: "TEST: new client account #{client.symbol} created." } | ||
expect(Client.send_notification_to_slack(text, options)).to eq("ok") | ||
end | ||
|
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# "attributes" => { | ||
# "symbol" => "BL", | ||
# "name" => "British Library", | ||
# "contact_email" => "[email protected]", | ||
# "system_email" => "[email protected]", | ||
# "country_code" => "GB" } } } | ||
# end | ||
# | ||
|
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 |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
|
||
describe "reset client password", vcr: true do | ||
let(:provider) { create(:provider, symbol: "DATACITE", password_input: "12345") } | ||
let(:client) { create(:client, provider: provider, symbol: "DATACITE.DATACITE", contact_email: "[email protected]") } | ||
let(:client) { create(:client, provider: provider, symbol: "DATACITE.DATACITE", system_email: "[email protected]") } | ||
|
||
it "sends message" do | ||
response = User.reset(client.symbol) | ||
|