Skip to content

Commit

Permalink
Merge pull request #4441 from pulibrary/valid_patron_groups_in_tests
Browse files Browse the repository at this point in the history
Change to valid patron_group for tests
  • Loading branch information
christinach authored Oct 15, 2024
2 parents 1f46894 + 1e064b4 commit ff702a0
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/requests/form_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
let(:user_info) do
{
"patron_id" => "12345",
"patron_group" => "staff",
"patron_group" => "REG",
"user_name" => "Foo Request",
"user_barcode" => "22101007797777",
"email" => "foo@princeton.edu"
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/previews/request_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def service_error_email
bib:
}
submission = Requests::Generic.new(params)
submission.errors << { :reply_text => "Can not create hold", :create_hold => { note: "Hold can not be created" }, "id" => "10574699", "title" => "Mefisto : rivista di medicina, filosofia, storia", "author" => "", "user_name" => "Foo Request", "user_last_name" => "Request", "user_barcode" => "0000000000", "patron_id" => "00000", "patron_group" => "staff", "email" => "foo@princeton.edu", "source" => "pulsearch" }
submission.errors << { :reply_text => "Can not create hold", :create_hold => { note: "Hold can not be created" }, "id" => "10574699", "title" => "Mefisto : rivista di medicina, filosofia, storia", "author" => "", "user_name" => "Foo Request", "user_last_name" => "Request", "user_barcode" => "0000000000", "patron_id" => "00000", "patron_group" => "REG", "email" => "foo@princeton.edu", "source" => "pulsearch" }
Requests::RequestMailer.service_error_email([submission])
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/requests/scsb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/requests/clancy_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777",
"university_id" => "9999999", "patron_group" => "staff", "patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
"university_id" => "9999999", "patron_group" => "REG", "patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Requests::Patron.new(user:, patron_hash: valid_patron)
Expand Down Expand Up @@ -150,7 +150,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777",
"university_id" => "9999999", "patron_group" => "staff", "patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
"university_id" => "9999999", "patron_group" => "REG", "patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Requests::Patron.new(user:, patron_hash: valid_patron)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/form_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:user) { FactoryBot.build(:user) }
let(:test_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: }.with_indifferent_access
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/form_no_vcr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
context "Marquand item in Clancy" do
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:location_code) { 'scsbnypl' }
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/illiad_patron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe Requests::IlliadPatron, type: :controller, requests: true, patrons: true do
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu", "ldap" => ldap_data }.with_indifferent_access
end
let(:ldap_data) { { uid: 'foo', department: 'Library - Information Technology', address: 'Firestone Library$Library Information Technology', telephone: '123-456-7890', surname: 'Doe', givenname: 'Joe', email: 'joe@abc.com', pustatus: 'fac', status: 'faculty' }.with_indifferent_access }
Expand Down
8 changes: 4 additions & 4 deletions spec/models/requests/requestable_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: }.with_indifferent_access
end
Expand Down Expand Up @@ -786,7 +786,7 @@
let(:stubbed_questions) { default_stubbed_questions.merge(item_data?: false, circulates?: false, services: ["on_shelf"], recap_edd?: false, scsb_in_library_use?: false, ill_eligible?: true, patron:, on_order?: false, in_process?: false, eligible_for_library_services?: false, ask_me?: false, library_code: 'abc', aeon?: false) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"university_id" => "9999999", "patron_group" => "staff",
"university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: }.with_indifferent_access
end
Expand All @@ -807,7 +807,7 @@
let(:stubbed_questions) { default_stubbed_questions.merge(item_data?: false, circulates?: false, services: ["on_shelf"], recap_edd?: false, scsb_in_library_use?: false, ill_eligible?: true, patron:, on_order?: false, in_process?: true, eligible_for_library_services?: false, ask_me?: false, library_code: 'abc', aeon?: false) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"university_id" => "9999999", "patron_group" => "staff",
"university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: }.with_indifferent_access
end
Expand All @@ -827,7 +827,7 @@
let(:stubbed_questions) { default_stubbed_questions.merge(item_data?: false, circulates?: false, services: ["on_shelf"], recap_edd?: false, scsb_in_library_use?: false, ill_eligible?: true, patron:, on_order?: true, eligible_for_library_services?: false, ask_me?: false, library_code: 'abc', aeon?: false) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"university_id" => "9999999", "patron_group" => "staff",
"university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: }.with_indifferent_access
end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/requests/requestable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:user) { FactoryBot.build(:user) }
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu",
ldap: { netid: "foo", department: "Test", address: "Box 1234", telephone: nil, givenname: "Foo", surname: "Request",
email: "foo@princeton.edu", status: "staff", pustatus: "stf", universityid: "9999999", title: nil } }.with_indifferent_access
Expand Down Expand Up @@ -590,7 +590,7 @@
# user authentication tests
context 'When a princeton user with NetID visits the site' do
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Expand Down Expand Up @@ -656,7 +656,7 @@

context 'When a barcode only user visits the site' do
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request", "barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:patron) do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe Requests::Submission, requests: true do
let(:valid_patron) do
{ "netid" => "foo", "first_name" => "Foo", "last_name" => "Request",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "staff",
"barcode" => "22101007797777", "university_id" => "9999999", "patron_group" => "REG",
"patron_id" => "99999", "active_email" => "foo@princeton.edu" }.with_indifferent_access
end
let(:user_info) do
Expand Down

0 comments on commit ff702a0

Please sign in to comment.