Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Merge 260ada4 into 8c6fe6e
Browse files Browse the repository at this point in the history
  • Loading branch information
christinach committed May 5, 2021
2 parents 8c6fe6e + 260ada4 commit f342c01
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 8 deletions.
2 changes: 2 additions & 0 deletions app/views/locations/holding_locations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<th>Label</th>
<th>Library</th>
<th>Holding Library</th>
<th>Remote Storage</th>
<th>Hours Location</th>
<th>Aeon Location</th>
<th>ReCAP EDD</th>
Expand All @@ -26,6 +27,7 @@
<td><%= holding_location.label %></td>
<td><%= link_to holding_location.library.code, holding_location.library %></td>
<td><%= holding_library_render holding_location %></td>
<td><%= holding_location.remote_storage %></td>
<td><%= hours_render holding_location %></td>
<td><%= holding_location.aeon_location %></td>
<td><%= holding_location.recap_electronic_delivery_location %></td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
json.extract! holding_location, :label, :code, :aeon_location,
:recap_electronic_delivery_location, :open, :requestable,
:always_requestable, :circulates
:always_requestable, :circulates, :remote_storage
5 changes: 5 additions & 0 deletions app/views/locations/holding_locations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<%= holding_library_render @holding_location %>
</p>

<p>
<strong>Remote Storage:</strong>
<%= @holding_location.remote_storage %>
</p>

<p>
<strong>Hours Location:</strong>
<%= hours_render @holding_location %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddRemoteStorageToHoldingLocation < ActiveRecord::Migration[5.2]
def change
add_column :locations_holding_locations, :remote_storage, :string
end
end
1 change: 0 additions & 1 deletion lib/generators/locations/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class InstallGenerator < Rails::Generators::Base

def add_gems
gem 'bootstrap-sass'
gem 'yaml_db', '~> 0.6'
gem 'jquery-rails'
Bundler.with_clean_env do
run "bundle install"
Expand Down
8 changes: 4 additions & 4 deletions locations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Gem::Specification.new do |s|

s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']

s.add_dependency 'rails', '~> 5.1'
s.add_dependency 'rails', '~> 5.2.4'
s.add_dependency 'bootstrap-sass', '~> 3.3'
s.add_dependency 'friendly_id', '~> 5.1.0'
s.add_dependency 'yaml_db', '~> 0.6'
s.add_dependency 'yaml_db', '~> 0.7'
s.add_dependency 'jquery-tablesorter', '~> 1.21'

s.add_development_dependency 'sqlite3'
s.add_development_dependency 'rspec-rails', '~> 3.1'
s.add_development_dependency 'engine_cart', '~> 1.2'
s.add_development_dependency 'engine_cart', '~> 2.1'
s.add_development_dependency 'factory_girl_rails', '~> 4.5.0'
s.add_development_dependency 'faker', '~> 1.4.3'
s.add_development_dependency 'faker', '~> 1.9'
s.add_development_dependency 'database_cleaner', '~> 1.3'
s.add_development_dependency 'poltergeist'
s.add_development_dependency 'coveralls'
Expand Down
3 changes: 3 additions & 0 deletions spec/factories/locations/holding_locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
circulates [true, false].sample
code
library { build(:library, library_args) }
remote_storage 'recap_rmt'
end

factory :holding_location_locator, class: 'Locations::HoldingLocation' do
Expand All @@ -30,6 +31,7 @@
circulates [true, false].sample
code 'f'
library { build(:library, library_args) }
remote_storage
hours_location { build(:hours_location, hours_locations_args) }
end

Expand All @@ -46,5 +48,6 @@
circulates true
code 'sciss'
library { build(:library, library_args) }
remote_storage
end
end
5 changes: 5 additions & 0 deletions spec/models/locations/holding_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ module Locations
expect(subject.valid?).to eq true
end

it "is valid without a remote_storage" do
subject.send("remote_storage=", nil)
expect(subject.valid?).to eq true
end

it 'code must be unique' do
expect {
FactoryGirl.create(:holding_location, code: subject.code)
Expand Down
9 changes: 8 additions & 1 deletion spec/requests/locations/holding_locations_json_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module Locations
requestable: holding_location.requestable,
always_requestable: holding_location.always_requestable,
circulates: holding_location.circulates,
remote_storage: holding_location.remote_storage,
path: holding_location_path(holding_location, format: :json),
library: {
label: holding_location.library.label,
Expand All @@ -49,6 +50,7 @@ module Locations
requestable: holding_location.requestable,
always_requestable: holding_location.always_requestable,
circulates: holding_location.circulates,
remote_storage: holding_location.remote_storage,
path: holding_location_path(holding_location, format: :json),
library: {
label: holding_location.library.label,
Expand All @@ -68,7 +70,6 @@ module Locations
expected << attrs
get holding_locations_path, params: { format: :json }
expect(response.body).to eq expected.sort_by{ |k| k[:code] }.to_json

end

it "/holding_locations/{code} looks as we'd expect without hours_location" do
Expand All @@ -90,6 +91,7 @@ module Locations
requestable: holding_location.requestable,
always_requestable: holding_location.always_requestable,
circulates: holding_location.circulates,
remote_storage: holding_location.remote_storage,
library: {
label: holding_location.library.label,
code: holding_location.library.code,
Expand Down Expand Up @@ -136,6 +138,7 @@ module Locations
requestable: holding_location.requestable,
always_requestable: holding_location.always_requestable,
circulates: holding_location.circulates,
remote_storage: holding_location.remote_storage,
library: {
label: holding_location.library.label,
code: holding_location.library.code,
Expand Down Expand Up @@ -184,6 +187,7 @@ module Locations
requestable: holding_location.requestable,
always_requestable: holding_location.always_requestable,
circulates: holding_location.circulates,
remote_storage: holding_location.remote_storage,
library: {
label: holding_location.library.label,
code: holding_location.library.code,
Expand Down Expand Up @@ -239,6 +243,7 @@ module Locations
holding_location.requestable,
holding_location.always_requestable,
holding_location.circulates,
holding_location.remote_storage,
holding_location.library.code
]
expected << attrs
Expand All @@ -256,6 +261,7 @@ module Locations
holding_location.requestable,
holding_location.always_requestable,
holding_location.circulates,
holding_location.remote_storage,
holding_location.library.code,
holding_location.hours_location.code
]
Expand Down Expand Up @@ -286,6 +292,7 @@ module Locations
holding_location.requestable,
holding_location.always_requestable,
holding_location.circulates,
holding_location.remote_storage,
holding_location.library.code,
holding_location.hours_location.code
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TestAppGenerator < Rails::Generators::Base

def add_gems
gem 'factory_girl_rails', '~> 4.5.0', group: [:development, :test]
gem 'faker', '~> 1.4.3', group: [:development, :test]
gem 'faker', '~> 1.9', group: [:development, :test]
end

def install_engine
Expand Down

0 comments on commit f342c01

Please sign in to comment.