Skip to content

Commit

Permalink
fix specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 7, 2020
1 parent 911ccb2 commit 862b923
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/export_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def repositories
accountName: name,
fabricaAccountId: client.symbol,
parentFabricaAccountId: client.provider.present? ? client.provider.symbol : nil,
isActive: client.deleted_at.blank?
isActive: client.deleted_at.blank?,
accountDescription: client.description,
accountWebsite: client.url,
generalContactEmail: client.system_email,
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def query(query, options={})
must << { term: { opendoar_id: options[:opendoar_id] }} if options[:opendoar_id].present?
must << { term: { client_type: options[:client_type] }} if options[:client_type].present?
must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted]
must_not << { terms: { symbol: !%w(CROSSREF.CITATIONS MEDRA.CITATIONS JALC.CITATIONS KISTI.CITATIONS OP.CITATIONS) }} if options[:exclude_registration_agencies]
must_not << { terms: { uid: %w(crossref.citations medra.citations jalc.citations kisti.citations op.citations) }} if options[:exclude_registration_agencies]
elsif self.name == "Doi"
must << { terms: { aasm_state: options[:state].to_s.split(",") }} if options[:state].present?
must << { range: { registered: { gte: "#{options[:registered].split(",").min}||/y", lte: "#{options[:registered].split(",").max}||/y", format: "yyyy" }}} if options[:registered].present?
Expand All @@ -243,7 +243,7 @@ def query(query, options={})
must << { term: { "client.re3data_id" => options[:re3data_id].gsub("/", '\/').upcase }} if options[:re3data_id].present?
must << { term: { "client.opendoar_id" => options[:opendoar_id] }} if options[:opendoar_id].present?
must << { terms: { "client.certificate" => options[:certificate].split(",") }} if options[:certificate].present?
must_not << { terms: { "client.symbol" => !%w(CROSSREF.CITATIONS MEDRA.CITATIONS JALC.CITATIONS KISTI.CITATIONS OP.CITATIONS) }} if options[:exclude_registration_agencies]
must_not << { terms: { "client.uid" => %w(crossref.citations medra.citations jalc.citations kisti.citations op.citations) }} if options[:exclude_registration_agencies]
elsif self.name == "Event"
must << { term: { subj_id: URI.decode(options[:subj_id]) }} if options[:subj_id].present?
must << { term: { obj_id: URI.decode(options[:obj_id]) }} if options[:obj_id].present?
Expand Down
7 changes: 0 additions & 7 deletions spec/requests/exports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
let!(:dois) { create_list(:doi, 3, client: client, aasm_state: "findable") }

describe "GET /export/organizations", elasticsearch: true do

before do
Doi.import
Provider.import
Expand All @@ -27,11 +26,9 @@

expect(last_response.status).to eq(200)
end

end

describe "GET /export/repositories", elasticsearch: true do

before do
Doi.import
Client.import
Expand All @@ -43,11 +40,9 @@

expect(last_response.status).to eq(200)
end

end

describe "GET /export/contacts", elasticsearch: true do

before do
Doi.import
Client.import
Expand All @@ -60,7 +55,5 @@

expect(last_response.status).to eq(200)
end

end

end

0 comments on commit 862b923

Please sign in to comment.