-
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.
Merge branch 'master' into improve_count_performance
- Loading branch information
Showing
12 changed files
with
363 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "factory_bot_rails" | ||
|
||
fail "Seed tasks can only be used in the development enviroment" if Rails.env.production? | ||
fail "You need to set up a MDS_USERNAME and MDS_PASSWORD" if ENV["MDS_USERNAME"].blank? || ENV["MDS_PASSWORD"].blank? | ||
|
||
FactoryBot.create(:provider, symbol: "ADMIN") if Provider.where(symbol: "ADMIN").blank? | ||
provider = Provider.where(symbol: "DATACITE").first || FactoryBot.create(:provider, symbol: "DATACITE") | ||
client = Client.where(symbol: "DATACITE.TEST").first || FactoryBot.create(:client, provider: provider, symbol: ENV["MDS_USERNAME"], password: ENV["MDS_PASSWORD"]) | ||
if Prefix.where(uid: "10.14454").blank? | ||
prefix = FactoryBot.create(:prefix, uid: "10.14454") | ||
FactoryBot.create(:client_prefix, client_id: client.id, prefix_id: prefix.id) | ||
end | ||
dois = FactoryBot.create_list(:doi, 10, client: client, state: "findable") | ||
FactoryBot.create_list(:event_for_datacite_related, 3, obj_id: dois.first.doi) | ||
FactoryBot.create_list(:event_for_datacite_usage, 2, obj_id: dois.first.doi) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "factory_bot_rails" | ||
|
||
fail "Seed tasks can only be used in the development enviroment" if Rails.env.production? | ||
|
||
after "development:base" do | ||
client = Client.all.first | ||
dois = FactoryBot.create_list(:doi, 70, client: client, state: "findable") | ||
|
||
FactoryBot.create_list(:event_for_datacite_related, 34, obj_id: dois.first.doi) | ||
FactoryBot.create_list(:event_for_datacite_usage, 32, obj_id: dois.first.doi) | ||
FactoryBot.create(:event_for_datacite_orcid_auto_update, subj_id: dois.first.doi, obj_id: "http://orcid.org/0000-0003-2926-8353") | ||
FactoryBot.create_list(:event_for_datacite_orcid_auto_update, 5, obj_id: "http://orcid.org/0000-0003-2926-8353") | ||
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
describe "Mailable", type: :model, vcr: true do | ||
let(:token) { User.generate_token } | ||
let(:provider) { create(:provider, symbol: "DATACITE") } | ||
let(:provider) { create(:provider, symbol: "DATACITE", name: "DataCite", system_email: "[email protected]") } | ||
let(:client) { create(:client, symbol: "DATACITE.DATACITE", name: "DataCite Repository", system_email: "[email protected]", provider: provider) } | ||
let(:title) { "DataCite Fabrica" } | ||
|
||
|
@@ -50,9 +50,17 @@ | |
|
||
context "send_notification_to_slack" do | ||
it "succeeds" do | ||
text = "Using contact email #{client.system_email}." | ||
text = "Using system 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 | ||
end | ||
|
||
context "send_notification_to_slack provider" do | ||
it "succeeds" do | ||
text = "Using system email #{provider.system_email}." | ||
options = { title: "TEST: new provider account #{provider.symbol} created." } | ||
expect(Client.send_notification_to_slack(text, options)).to eq("ok") | ||
end | ||
end | ||
end |
Oops, something went wrong.