enju_circulation 0.1.2 → 0.2.0.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/app/controllers/carrier_type_has_checkout_types_controller.rb +14 -4
  4. data/app/controllers/checked_items_controller.rb +13 -2
  5. data/app/controllers/checkins_controller.rb +13 -3
  6. data/app/controllers/checkout_types_controller.rb +12 -2
  7. data/app/controllers/checkouts_controller.rb +26 -25
  8. data/app/controllers/circulation_statuses_controller.rb +11 -1
  9. data/app/controllers/concerns/enju_circulation/controller.rb +12 -0
  10. data/app/controllers/demands_controller.rb +12 -2
  11. data/app/controllers/item_has_use_restrictions_controller.rb +13 -2
  12. data/app/controllers/lending_policies_controller.rb +18 -4
  13. data/app/controllers/manifestation_checkout_stats_controller.rb +14 -6
  14. data/app/controllers/manifestation_reserve_stats_controller.rb +15 -4
  15. data/app/controllers/reserves_controller.rb +17 -9
  16. data/app/controllers/use_restrictions_controller.rb +11 -1
  17. data/app/controllers/user_checkout_stats_controller.rb +14 -4
  18. data/app/controllers/user_group_has_checkout_types_controller.rb +12 -2
  19. data/app/controllers/user_reserve_stats_controller.rb +14 -4
  20. data/app/helpers/items_helper.rb +2 -2
  21. data/app/jobs/manifestation_checkout_stat_job.rb +7 -0
  22. data/app/jobs/manifestation_reserve_stat_job.rb +7 -0
  23. data/app/jobs/user_checkout_stat_job.rb +7 -0
  24. data/app/jobs/user_reserve_stat_job.rb +7 -0
  25. data/app/models/checked_item.rb +1 -1
  26. data/app/models/concerns/enju_circulation/enju_accept.rb +16 -0
  27. data/app/models/concerns/enju_circulation/enju_basket.rb +30 -0
  28. data/app/models/concerns/enju_circulation/enju_carrier_type.rb +11 -0
  29. data/app/models/concerns/enju_circulation/enju_item.rb +157 -0
  30. data/app/models/concerns/enju_circulation/enju_manifestation.rb +77 -0
  31. data/app/models/concerns/enju_circulation/enju_profile.rb +13 -0
  32. data/app/models/concerns/enju_circulation/enju_user.rb +50 -0
  33. data/app/models/concerns/enju_circulation/enju_user_group.rb +17 -0
  34. data/app/models/concerns/enju_circulation/enju_withdraw.rb +16 -0
  35. data/app/models/manifestation_checkout_stat_state_machine.rb +1 -1
  36. data/app/models/reserve.rb +7 -2
  37. data/app/policies/carrier_type_has_checkout_type_policy.rb +21 -0
  38. data/app/policies/checked_item_policy.rb +21 -0
  39. data/app/policies/checkin_policy.rb +21 -0
  40. data/app/policies/checkout_policy.rb +39 -0
  41. data/app/policies/checkout_type_policy.rb +23 -0
  42. data/app/policies/circulation_status_policy.rb +23 -0
  43. data/app/policies/demand_policy.rb +21 -0
  44. data/app/policies/item_has_use_restriction_policy.rb +21 -0
  45. data/app/policies/item_policy.rb +27 -0
  46. data/app/policies/lending_policy_policy.rb +21 -0
  47. data/app/policies/manifestation_checkout_stat_policy.rb +21 -0
  48. data/app/policies/manifestation_reserve_stat_policy.rb +21 -0
  49. data/app/policies/reserve_policy.rb +37 -0
  50. data/app/policies/use_restriction_policy.rb +23 -0
  51. data/app/policies/user_checkout_stat_policy.rb +21 -0
  52. data/app/policies/user_group_has_checkout_type_policy.rb +21 -0
  53. data/app/policies/user_reserve_stat_policy.rb +21 -0
  54. data/app/views/carrier_type_has_checkout_types/index.html.erb +3 -3
  55. data/app/views/carrier_type_has_checkout_types/show.html.erb +1 -1
  56. data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +5 -0
  57. data/app/views/carrier_types/_checkout_form.html.erb +2 -4
  58. data/app/views/checkout_types/index.html.erb +4 -4
  59. data/app/views/checkout_types/show.html.erb +2 -2
  60. data/app/views/checkouts/_index.html.erb +1 -1
  61. data/app/views/checkouts/_index_overdue.html.erb +4 -5
  62. data/app/views/checkouts/_index_user.html.erb +5 -5
  63. data/app/views/checkouts/_list.html.erb +2 -2
  64. data/app/views/checkouts/_reserved_facet.html.erb +2 -2
  65. data/app/views/checkouts/edit.html.erb +1 -1
  66. data/app/views/checkouts/index.html.erb +2 -2
  67. data/app/views/checkouts/index.rss.builder +2 -2
  68. data/app/views/checkouts/index.txt.erb +1 -1
  69. data/app/views/checkouts/show.html.erb +10 -6
  70. data/app/views/circulation_statuses/index.html.erb +4 -4
  71. data/app/views/circulation_statuses/show.html.erb +1 -1
  72. data/app/views/reserves/_state_facet.html.erb +2 -2
  73. data/app/views/reserves/index.html.erb +6 -4
  74. data/app/views/reserves/show.html.erb +1 -1
  75. data/app/views/use_restrictions/index.html.erb +4 -4
  76. data/app/views/use_restrictions/show.html.erb +1 -1
  77. data/app/views/user_group_has_checkout_types/index.html.erb +3 -3
  78. data/app/views/user_group_has_checkout_types/show.html.erb +1 -1
  79. data/app/views/user_groups/_checkout_form.html.erb +2 -16
  80. data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +14 -0
  81. data/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +9 -0
  82. data/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +9 -0
  83. data/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +9 -0
  84. data/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +9 -0
  85. data/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +9 -0
  86. data/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
  87. data/lib/enju_circulation/version.rb +1 -1
  88. data/lib/enju_circulation.rb +0 -20
  89. data/lib/generators/enju_circulation/setup/setup_generator.rb +16 -4
  90. data/lib/tasks/enju_circulation_tasks.rake +1 -1
  91. data/spec/controllers/carrier_type_has_checkout_types_controller_spec.rb +13 -13
  92. data/spec/controllers/checked_items_controller_spec.rb +6 -6
  93. data/spec/controllers/checkins_controller_spec.rb +6 -6
  94. data/spec/controllers/checkout_types_controller_spec.rb +11 -11
  95. data/spec/controllers/checkouts_controller_spec.rb +72 -71
  96. data/spec/controllers/circulation_statuses_controller_spec.rb +12 -12
  97. data/spec/controllers/item_has_use_restrictions_controller_spec.rb +11 -11
  98. data/spec/controllers/lending_policies_controller_spec.rb +14 -14
  99. data/spec/controllers/manifestation_checkout_stats_controller_spec.rb +6 -6
  100. data/spec/controllers/manifestation_reserve_stats_controller_spec.rb +6 -6
  101. data/spec/controllers/reserves_controller_spec.rb +5 -5
  102. data/spec/controllers/use_restrictions_controller_spec.rb +14 -14
  103. data/spec/controllers/user_checkout_stats_controller_spec.rb +8 -8
  104. data/spec/controllers/user_group_has_checkout_types_controller_spec.rb +11 -11
  105. data/spec/controllers/user_reserve_stats_controller_spec.rb +8 -8
  106. data/spec/dummy/app/assets/javascripts/application.js +1 -0
  107. data/spec/dummy/app/controllers/application_controller.rb +8 -4
  108. data/spec/dummy/app/models/user.rb +3 -5
  109. data/spec/dummy/config/application.rb +6 -37
  110. data/spec/dummy/config/environments/development.rb +22 -18
  111. data/spec/dummy/config/environments/production.rb +46 -34
  112. data/spec/dummy/config/environments/test.rb +19 -14
  113. data/spec/dummy/config/initializers/enju_leaf.rb +5 -0
  114. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
  115. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  116. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  117. data/spec/dummy/db/schema.rb +30 -2
  118. data/spec/fixtures/profiles.yml +1 -1
  119. data/spec/models/manifestation_checkout_stat_spec.rb +3 -4
  120. data/spec/models/manifestation_reserve_stat_spec.rb +1 -1
  121. data/spec/models/user_checkout_stat_spec.rb +1 -1
  122. data/spec/models/user_reserve_stat_spec.rb +1 -1
  123. data/spec/support/devise.rb +2 -2
  124. data/spec/views/checkout_types/index.html.erb_spec.rb +1 -0
  125. data/spec/views/checkout_types/show.html.erb_spec.rb +1 -0
  126. data/spec/views/checkouts/index.html.erb_spec.rb +1 -3
  127. data/spec/views/checkouts/show.html.erb_spec.rb +5 -4
  128. data/spec/views/profiles/show.html.erb_spec.rb +2 -1
  129. data/spec/views/reserves/index.html.erb_spec.rb +3 -0
  130. data/spec/views/use_restrictions/index.html.erb_spec.rb +1 -0
  131. data/spec/views/use_restrictions/show.html.erb_spec.rb +1 -0
  132. metadata +147 -38
  133. data/app/models/enju_circulation/ability.rb +0 -114
  134. data/app/views/circulation_statuses/show.mobile.erb +0 -24
  135. data/app/workers/manifestation_checkout_stat_queue.rb +0 -7
  136. data/app/workers/manifestation_reserve_stat_queue.rb +0 -7
  137. data/app/workers/user_checkout_stat_queue.rb +0 -7
  138. data/app/workers/user_reserve_stat_queue.rb +0 -7
  139. data/lib/enju_circulation/accept.rb +0 -23
  140. data/lib/enju_circulation/basket.rb +0 -37
  141. data/lib/enju_circulation/carrier_type.rb +0 -15
  142. data/lib/enju_circulation/controller.rb +0 -21
  143. data/lib/enju_circulation/item.rb +0 -166
  144. data/lib/enju_circulation/manifestation.rb +0 -84
  145. data/lib/enju_circulation/profile.rb +0 -23
  146. data/lib/enju_circulation/user.rb +0 -61
  147. data/lib/enju_circulation/user_group.rb +0 -21
  148. data/lib/enju_circulation/withdraw.rb +0 -23
  149. data/spec/dummy/app/models/ability.rb +0 -111
  150. data/spec/dummy/app/models/local_agent.rb +0 -13
  151. data/spec/dummy/config/application.yml +0 -42
@@ -17,7 +17,7 @@
17
17
  <%- @use_restrictions.each do |use_restriction| -%>
18
18
  <tr class="line<%= cycle("0", "1") -%>">
19
19
  <td>
20
- <%- if can? :update, use_restriction -%>
20
+ <%- if policy(use_restriction).update? -%>
21
21
  <%= move_position(use_restriction) -%>
22
22
  <%- end -%>
23
23
  </td>
@@ -28,10 +28,10 @@
28
28
  <%= use_restriction.note %>
29
29
  </td>
30
30
  <td>
31
- <%- if can? :update, use_restriction -%>
31
+ <%- if policy(use_restriction).update? -%>
32
32
  <%= link_to t('page.edit'), edit_use_restriction_path(use_restriction) -%>
33
33
  <% end %>
34
- <%- if can? :delete, use_restriction -%>
34
+ <%- if policy(use_restriction).destroy? -%>
35
35
  <%= link_to t('page.destroy'), use_restriction_path(use_restriction), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
36
36
  <%- end -%>
37
37
  </td>
@@ -44,7 +44,7 @@
44
44
 
45
45
  <div id="submenu" class="ui-corner-all ui-widget-content">
46
46
  <ul>
47
- <%- if can? :create, UseRestriction -%>
47
+ <%- if policy(UseRestriction).create? -%>
48
48
  <li><%= link_to t('page.new', model: t('activerecord.models.use_restriction')), new_use_restriction_path -%></li>
49
49
  <%- end -%>
50
50
  </ul>
@@ -23,7 +23,7 @@
23
23
 
24
24
  <div id="submenu" class="ui-corner-all ui-widget-content">
25
25
  <ul>
26
- <%- if can? :update, @use_restriction -%>
26
+ <%- if policy(@use_restriction).update? -%>
27
27
  <li><%= link_to t('page.edit'), edit_use_restriction_path(@use_restriction) -%></li>
28
28
  <%- end -%>
29
29
  <li><%= back_to_index(flash[:page_info]) -%></li>
@@ -15,10 +15,10 @@
15
15
  <td><%= link_to user_group_has_checkout_type.checkout_type.display_name.localize.localize, user_group_has_checkout_type.checkout_type -%></td>
16
16
  <td>
17
17
  <%= link_to t('page.show'), user_group_has_checkout_type -%>
18
- <%- if can? :update, user_group_has_checkout_type -%>
18
+ <%- if policy(user_group_has_checkout_type).update? -%>
19
19
  <%= link_to t('page.edit'), edit_user_group_has_checkout_type_path(user_group_has_checkout_type) -%>
20
20
  <% end %>
21
- <%- if can? :delete, user_group_has_checkout_type -%>
21
+ <%- if policy(user_group_has_checkout_type).destroy? -%>
22
22
  <%= link_to t('page.destroy'), user_group_has_checkout_type, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
23
23
  <% end %>
24
24
  </td>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <div id="submenu" class="ui-corner-all ui-widget-content">
33
33
  <ul>
34
- <%- if can? :create, UserGroupHasCheckoutType -%>
34
+ <%- if policy(UserGroupHasCheckoutType).create? -%>
35
35
  <li><%= link_to t('page.new', model: t('activerecord.models.user_group_has_checkout_type')), new_user_group_has_checkout_type_path -%></li>
36
36
  <% end %>
37
37
  </ul>
@@ -53,7 +53,7 @@
53
53
 
54
54
  <div id="submenu" class="ui-corner-all ui-widget-content">
55
55
  <ul>
56
- <% if can?(:update, @user_group_has_checkout_type) %>
56
+ <% if policy(@user_group_has_checkout_type).update? %>
57
57
  <li><%= link_to t('page.edit'), edit_user_group_has_checkout_type_path(@user_group_has_checkout_type) -%></li>
58
58
  <% end %>
59
59
  <li><%= back_to_index(flash[:page_info]) -%></li>
@@ -1,21 +1,7 @@
1
1
  <div class="field">
2
2
  <%= f.label t('activerecord.models.user_group_has_checkout_type') %><br />
3
3
  <%= f.fields_for :user_group_has_checkout_types do |checkout_form| %>
4
- <%= checkout_form.label :checkout_type_id -%>
5
- <%= checkout_form.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}) %>
6
- <%= checkout_form.link_to_remove t('page.remove'), confirm: t('page.are_you_sure') %>
7
- <br />
8
- <%= checkout_form.label :checkout_limit -%>
9
- <%= checkout_form.text_field :checkout_limit, class: 'resource_integer' %>
10
- <%= checkout_form.label :checkout_period -%>
11
- <%= checkout_form.text_field :checkout_period, class: 'resource_integer' %>
12
- <%= checkout_form.label :checkout_renewal_limit -%>
13
- <%= checkout_form.text_field :checkout_renewal_limit, class: 'resource_integer' %>
14
- <br />
15
- <%= checkout_form.label :reservation_limit -%>
16
- <%= checkout_form.text_field :reservation_limit, class: 'resource_integer' %>
17
- <%= checkout_form.label :set_due_date_before_closing_day -%>
18
- <%= checkout_form.check_box :set_due_date_before_closing_day %>
4
+ <%= render 'user_group_has_checkout_type_fields', f: checkout_form %>
19
5
  <% end %>
20
- <p><%= f.link_to_add t('page.add'), :user_group_has_checkout_types %></p>
6
+ <p><%= link_to_add_association t('page.add'), f, :user_group_has_checkout_types %></p>
21
7
  </div>
@@ -0,0 +1,14 @@
1
+ <div class="nested-fields">
2
+ <%= f.label :checkout_limit -%>
3
+ <%= f.text_field :checkout_limit, class: 'resource_integer' %>
4
+ <%= f.label :checkout_period -%>
5
+ <%= f.text_field :checkout_period, class: 'resource_integer' %>
6
+ <%= f.label :checkout_renewal_limit -%>
7
+ <%= f.text_field :checkout_renewal_limit, class: 'resource_integer' %>
8
+ <br />
9
+ <%= f.label :reservation_limit -%>
10
+ <%= f.text_field :reservation_limit, class: 'resource_integer' %>
11
+ <%= f.label :set_due_date_before_closing_day -%>
12
+ <%= f.check_box :set_due_date_before_closing_day %>
13
+ <%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %>
14
+ </div>
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToReserveTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :reserve_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :reserve_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToManifestationCheckoutStatTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :manifestation_checkout_stat_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :manifestation_checkout_stat_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToManifestationReserveStatTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :manifestation_reserve_stat_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :manifestation_reserve_stat_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserCheckoutStatTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_checkout_stat_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_checkout_stat_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserReserveStatTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_reserve_stat_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_reserve_stat_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyOnManifestationIdToReserve < ActiveRecord::Migration
2
+ def change
3
+ add_foreign_key :reserves, :manifestations
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuCirculation
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0.beta.1"
3
3
  end
@@ -1,27 +1,7 @@
1
1
  require "enju_circulation/engine"
2
- require "enju_circulation/manifestation"
3
- require "enju_circulation/item"
4
- require "enju_circulation/user"
5
- require "enju_circulation/user_group"
6
- require "enju_circulation/profile"
7
- require "enju_circulation/accept"
8
- require "enju_circulation/basket"
9
- require "enju_circulation/carrier_type"
10
- require "enju_circulation/withdraw"
11
- require "enju_circulation/controller"
12
2
  require "enju_circulation/helper"
13
3
 
14
4
  module EnjuCirculation
15
5
  end
16
6
 
17
- ActionController::Base.send :include, EnjuCirculation::Controller
18
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuManifestation
19
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuItem
20
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuUser
21
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuUserGroup
22
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuProfile
23
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuAccept
24
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuBasket
25
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuCarrierType
26
- ActiveRecord::Base.send :include, EnjuCirculation::EnjuWithdraw
27
7
  ActionView::Base.send :include, EnjuCirculation::ManifestationsHelper
@@ -10,10 +10,22 @@ class EnjuCirculation::SetupGenerator < Rails::Generators::Base
10
10
  rake("enju_message_engine:install:migrations")
11
11
  generate("enju_event:setup")
12
12
  generate("enju_message:setup")
13
- inject_into_file 'app/controllers/application_controller.rb',
14
- " enju_circulation\n", :after => "enju_library\n"
15
- inject_into_file 'app/models/user.rb',
16
- " enju_circulation_user_model\n", :after => "enju_leaf_user_model\n"
13
+ inject_into_class "app/controllers/application_controller.rb", ApplicationController do
14
+ " include EnjuCirculation::Controller\n"
15
+ end
16
+ inject_into_class 'app/models/user.rb', User do
17
+ " include EnjuCirculation::EnjuUser\n"
18
+ end
19
+ append_to_file "config/initializers/enju_leaf.rb", <<EOS
20
+ Accept.include(EnjuCirculation::EnjuAccept)
21
+ Basket.include(EnjuCirculation::EnjuBasket)
22
+ CarrierType.include(EnjuCirculation::EnjuCarrierType)
23
+ Manifestation.include(EnjuCirculation::EnjuManifestation)
24
+ Item.include(EnjuCirculation::EnjuItem)
25
+ Profile.include(EnjuCirculation::EnjuProfile)
26
+ UserGroup.include(EnjuCirculation::EnjuUserGroup)
27
+ Withdraw.include(EnjuCirculation::EnjuWithdraw)
28
+ EOS
17
29
  append_to_file("config/schedule.rb", File.open(File.expand_path('../templates', __FILE__) + '/config/schedule.rb').read)
18
30
  append_to_file 'config/initializers/inflections.rb', <<EOS
19
31
  ActiveSupport::Inflector.inflections do |inflect|
@@ -8,7 +8,7 @@ namespace :enju_circulation do
8
8
  desc "create initial records for enju_circulation"
9
9
  task :setup => :environment do
10
10
  Dir.glob(Rails.root.to_s + '/db/fixtures/enju_circulation/*.yml').each do |file|
11
- ActiveRecord::Fixtures.create_fixtures('db/fixtures/enju_circulation', File.basename(file, '.*'))
11
+ ActiveRecord::FixtureSet.create_fixtures('db/fixtures/enju_circulation', File.basename(file, '.*'))
12
12
  end
13
13
 
14
14
  Rake::Task['enju_event:setup'].invoke
@@ -13,7 +13,7 @@ describe CarrierTypeHasCheckoutTypesController do
13
13
 
14
14
  it "assigns all carrier_type_has_checkout_types as @carrier_type_has_checkout_types" do
15
15
  get :index
16
- assigns(:carrier_type_has_checkout_types).should eq(CarrierTypeHasCheckoutType.all)
16
+ assigns(:carrier_type_has_checkout_types).should eq(CarrierTypeHasCheckoutType.page(1))
17
17
  end
18
18
  end
19
19
 
@@ -22,7 +22,7 @@ describe CarrierTypeHasCheckoutTypesController do
22
22
 
23
23
  it "assigns all carrier_type_has_checkout_types as @carrier_type_has_checkout_types" do
24
24
  get :index
25
- assigns(:carrier_type_has_checkout_types).should eq(CarrierTypeHasCheckoutType.all)
25
+ assigns(:carrier_type_has_checkout_types).should eq(CarrierTypeHasCheckoutType.page(1))
26
26
  end
27
27
  end
28
28
 
@@ -31,7 +31,7 @@ describe CarrierTypeHasCheckoutTypesController do
31
31
 
32
32
  it "assigns all carrier_type_has_checkout_types as @carrier_type_has_checkout_types" do
33
33
  get :index
34
- assigns(:carrier_type_has_checkout_types).should be_empty
34
+ assigns(:carrier_type_has_checkout_types).should be_nil
35
35
  response.should be_forbidden
36
36
  end
37
37
  end
@@ -39,7 +39,7 @@ describe CarrierTypeHasCheckoutTypesController do
39
39
  describe "When not logged in" do
40
40
  it "assigns all carrier_type_has_checkout_types as @carrier_type_has_checkout_types" do
41
41
  get :index
42
- assigns(:carrier_type_has_checkout_types).should be_empty
42
+ assigns(:carrier_type_has_checkout_types).should be_nil
43
43
  response.should redirect_to(new_user_session_url)
44
44
  end
45
45
  end
@@ -101,7 +101,7 @@ describe CarrierTypeHasCheckoutTypesController do
101
101
 
102
102
  it "should not assign the requested carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
103
103
  get :new
104
- assigns(:carrier_type_has_checkout_type).should_not be_valid
104
+ assigns(:carrier_type_has_checkout_type).should be_nil
105
105
  response.should be_forbidden
106
106
  end
107
107
  end
@@ -111,7 +111,7 @@ describe CarrierTypeHasCheckoutTypesController do
111
111
 
112
112
  it "should not assign the requested carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
113
113
  get :new
114
- assigns(:carrier_type_has_checkout_type).should_not be_valid
114
+ assigns(:carrier_type_has_checkout_type).should be_nil
115
115
  response.should be_forbidden
116
116
  end
117
117
  end
@@ -119,7 +119,7 @@ describe CarrierTypeHasCheckoutTypesController do
119
119
  describe "When not logged in" do
120
120
  it "should not assign the requested carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
121
121
  get :new
122
- assigns(:carrier_type_has_checkout_type).should_not be_valid
122
+ assigns(:carrier_type_has_checkout_type).should be_nil
123
123
  response.should redirect_to(new_user_session_url)
124
124
  end
125
125
  end
@@ -205,7 +205,7 @@ describe CarrierTypeHasCheckoutTypesController do
205
205
  describe "with valid params" do
206
206
  it "assigns a newly created carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
207
207
  post :create, :carrier_type_has_checkout_type => @attrs
208
- assigns(:carrier_type_has_checkout_type).should be_valid
208
+ assigns(:carrier_type_has_checkout_type).should be_nil
209
209
  end
210
210
 
211
211
  it "should be forbidden" do
@@ -217,7 +217,7 @@ describe CarrierTypeHasCheckoutTypesController do
217
217
  describe "with invalid params" do
218
218
  it "assigns a newly created but unsaved carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
219
219
  post :create, :carrier_type_has_checkout_type => @invalid_attrs
220
- assigns(:carrier_type_has_checkout_type).should_not be_valid
220
+ assigns(:carrier_type_has_checkout_type).should be_nil
221
221
  end
222
222
 
223
223
  it "should be forbidden" do
@@ -233,7 +233,7 @@ describe CarrierTypeHasCheckoutTypesController do
233
233
  describe "with valid params" do
234
234
  it "assigns a newly created carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
235
235
  post :create, :carrier_type_has_checkout_type => @attrs
236
- assigns(:carrier_type_has_checkout_type).should be_valid
236
+ assigns(:carrier_type_has_checkout_type).should be_nil
237
237
  end
238
238
 
239
239
  it "should be forbidden" do
@@ -245,7 +245,7 @@ describe CarrierTypeHasCheckoutTypesController do
245
245
  describe "with invalid params" do
246
246
  it "assigns a newly created but unsaved carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
247
247
  post :create, :carrier_type_has_checkout_type => @invalid_attrs
248
- assigns(:carrier_type_has_checkout_type).should_not be_valid
248
+ assigns(:carrier_type_has_checkout_type).should be_nil
249
249
  end
250
250
 
251
251
  it "should be forbidden" do
@@ -259,7 +259,7 @@ describe CarrierTypeHasCheckoutTypesController do
259
259
  describe "with valid params" do
260
260
  it "assigns a newly created carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
261
261
  post :create, :carrier_type_has_checkout_type => @attrs
262
- assigns(:carrier_type_has_checkout_type).should be_valid
262
+ assigns(:carrier_type_has_checkout_type).should be_nil
263
263
  end
264
264
 
265
265
  it "should be forbidden" do
@@ -271,7 +271,7 @@ describe CarrierTypeHasCheckoutTypesController do
271
271
  describe "with invalid params" do
272
272
  it "assigns a newly created but unsaved carrier_type_has_checkout_type as @carrier_type_has_checkout_type" do
273
273
  post :create, :carrier_type_has_checkout_type => @invalid_attrs
274
- assigns(:carrier_type_has_checkout_type).should_not be_valid
274
+ assigns(:carrier_type_has_checkout_type).should be_nil
275
275
  end
276
276
 
277
277
  it "should be forbidden" do
@@ -43,7 +43,7 @@ describe CheckedItemsController do
43
43
 
44
44
  it "assigns empty as @checked_items" do
45
45
  get :index
46
- assigns(:checked_items).should be_empty
46
+ assigns(:checked_items).should be_nil
47
47
  response.should be_forbidden
48
48
  end
49
49
 
@@ -56,13 +56,13 @@ describe CheckedItemsController do
56
56
  describe "When not logged in" do
57
57
  it "assigns empty as @checked_items" do
58
58
  get :index
59
- assigns(:checked_items).should be_empty
59
+ assigns(:checked_items).should be_nil
60
60
  response.should redirect_to(new_user_session_url)
61
61
  end
62
62
 
63
63
  it "should not get index with basket_id and item_id" do
64
64
  get :index, :basket_id => 1, :item_id => 1
65
- assigns(:checked_items).should be_empty
65
+ assigns(:checked_items).should be_nil
66
66
  response.should redirect_to(new_user_session_url)
67
67
  end
68
68
  end
@@ -140,7 +140,7 @@ describe CheckedItemsController do
140
140
 
141
141
  it "should not assign the requested checked_item as @checked_item" do
142
142
  get :new, :basket_id => 3
143
- assigns(:checked_item).should_not be_valid
143
+ assigns(:checked_item).should be_nil
144
144
  response.should be_forbidden
145
145
  end
146
146
  end
@@ -148,7 +148,7 @@ describe CheckedItemsController do
148
148
  describe "When not logged in" do
149
149
  it "should not assign the requested checked_item as @checked_item" do
150
150
  get :new, :basket_id => 3
151
- assigns(:checked_item).should_not be_valid
151
+ assigns(:checked_item).should be_nil
152
152
  response.should redirect_to(new_user_session_url)
153
153
  end
154
154
  end
@@ -356,7 +356,7 @@ describe CheckedItemsController do
356
356
  end
357
357
 
358
358
  describe "When not logged in" do
359
- it "should not update checed_item" do
359
+ it "should not update checked_item" do
360
360
  put :update, :id => 1, :checked_item => { }, :basket_id => 1
361
361
  response.should redirect_to new_user_session_url
362
362
  end
@@ -123,7 +123,7 @@ describe CheckinsController do
123
123
 
124
124
  it "should not assign the requested checkin as @checkin" do
125
125
  get :new
126
- assigns(:checkin).should_not be_valid
126
+ assigns(:checkin).should be_nil
127
127
  response.should be_forbidden
128
128
  end
129
129
  end
@@ -131,7 +131,7 @@ describe CheckinsController do
131
131
  describe "When not logged in" do
132
132
  it "should not assign the requested checkin as @checkin" do
133
133
  get :new
134
- assigns(:checkin).should_not be_valid
134
+ assigns(:checkin).should be_nil
135
135
  response.should redirect_to(new_user_session_url)
136
136
  end
137
137
  end
@@ -189,7 +189,7 @@ describe CheckinsController do
189
189
  describe "with valid params" do
190
190
  it "assigns a newly created checkin as @checkin" do
191
191
  post :create, :checkin => @attrs
192
- assigns(:checkin).should_not be_valid
192
+ assigns(:checkin).should be_nil
193
193
  end
194
194
 
195
195
  it "should not create checkin without basket_id" do
@@ -216,7 +216,7 @@ describe CheckinsController do
216
216
  describe "with invalid params" do
217
217
  it "assigns a newly created but unsaved checkin as @checkin" do
218
218
  post :create, :checkin => @invalid_attrs
219
- assigns(:checkin).should_not be_valid
219
+ assigns(:checkin).should be_nil
220
220
  end
221
221
 
222
222
  it "should be forbidden" do
@@ -238,7 +238,7 @@ describe CheckinsController do
238
238
  describe "with valid params" do
239
239
  it "assigns a newly created checkin as @checkin" do
240
240
  post :create, :checkin => @attrs
241
- assigns(:checkin).should_not be_valid
241
+ assigns(:checkin).should be_nil
242
242
  end
243
243
 
244
244
  it "should not create checkin without basket_id" do
@@ -277,7 +277,7 @@ describe CheckinsController do
277
277
  describe "with valid params" do
278
278
  it "assigns a newly created checkin as @checkin" do
279
279
  post :create, :checkin => @attrs
280
- assigns(:checkin).should_not be_valid
280
+ assigns(:checkin).should be_nil
281
281
  end
282
282
 
283
283
  it "should be forbidden" do
@@ -31,7 +31,7 @@ describe CheckoutTypesController do
31
31
 
32
32
  it "assigns all checkout_types as @checkout_types" do
33
33
  get :index
34
- assigns(:checkout_types).should be_empty
34
+ assigns(:checkout_types).should be_nil
35
35
  response.should be_forbidden
36
36
  end
37
37
  end
@@ -39,7 +39,7 @@ describe CheckoutTypesController do
39
39
  describe "When not logged in" do
40
40
  it "assigns all checkout_types as @checkout_types" do
41
41
  get :index
42
- assigns(:checkout_types).should be_empty
42
+ assigns(:checkout_types).should be_nil
43
43
  response.should redirect_to(new_user_session_url)
44
44
  end
45
45
  end
@@ -101,7 +101,7 @@ describe CheckoutTypesController do
101
101
 
102
102
  it "should not assign the requested checkout_type as @checkout_type" do
103
103
  get :new
104
- assigns(:checkout_type).should_not be_valid
104
+ assigns(:checkout_type).should be_nil
105
105
  response.should be_forbidden
106
106
  end
107
107
  end
@@ -111,7 +111,7 @@ describe CheckoutTypesController do
111
111
 
112
112
  it "should not assign the requested checkout_type as @checkout_type" do
113
113
  get :new
114
- assigns(:checkout_type).should_not be_valid
114
+ assigns(:checkout_type).should be_nil
115
115
  response.should be_forbidden
116
116
  end
117
117
  end
@@ -119,7 +119,7 @@ describe CheckoutTypesController do
119
119
  describe "When not logged in" do
120
120
  it "should not assign the requested checkout_type as @checkout_type" do
121
121
  get :new
122
- assigns(:checkout_type).should_not be_valid
122
+ assigns(:checkout_type).should be_nil
123
123
  response.should redirect_to(new_user_session_url)
124
124
  end
125
125
  end
@@ -205,7 +205,7 @@ describe CheckoutTypesController do
205
205
  describe "with valid params" do
206
206
  it "assigns a newly created checkout_type as @checkout_type" do
207
207
  post :create, :checkout_type => @attrs
208
- assigns(:checkout_type).should be_valid
208
+ assigns(:checkout_type).should be_nil
209
209
  end
210
210
 
211
211
  it "should be forbidden" do
@@ -217,7 +217,7 @@ describe CheckoutTypesController do
217
217
  describe "with invalid params" do
218
218
  it "assigns a newly created but unsaved checkout_type as @checkout_type" do
219
219
  post :create, :checkout_type => @invalid_attrs
220
- assigns(:checkout_type).should_not be_valid
220
+ assigns(:checkout_type).should be_nil
221
221
  end
222
222
 
223
223
  it "should be forbidden" do
@@ -233,7 +233,7 @@ describe CheckoutTypesController do
233
233
  describe "with valid params" do
234
234
  it "assigns a newly created checkout_type as @checkout_type" do
235
235
  post :create, :checkout_type => @attrs
236
- assigns(:checkout_type).should be_valid
236
+ assigns(:checkout_type).should be_nil
237
237
  end
238
238
 
239
239
  it "should be forbidden" do
@@ -245,7 +245,7 @@ describe CheckoutTypesController do
245
245
  describe "with invalid params" do
246
246
  it "assigns a newly created but unsaved checkout_type as @checkout_type" do
247
247
  post :create, :checkout_type => @invalid_attrs
248
- assigns(:checkout_type).should_not be_valid
248
+ assigns(:checkout_type).should be_nil
249
249
  end
250
250
 
251
251
  it "should be forbidden" do
@@ -259,7 +259,7 @@ describe CheckoutTypesController do
259
259
  describe "with valid params" do
260
260
  it "assigns a newly created checkout_type as @checkout_type" do
261
261
  post :create, :checkout_type => @attrs
262
- assigns(:checkout_type).should be_valid
262
+ assigns(:checkout_type).should be_nil
263
263
  end
264
264
 
265
265
  it "should be forbidden" do
@@ -271,7 +271,7 @@ describe CheckoutTypesController do
271
271
  describe "with invalid params" do
272
272
  it "assigns a newly created but unsaved checkout_type as @checkout_type" do
273
273
  post :create, :checkout_type => @invalid_attrs
274
- assigns(:checkout_type).should_not be_valid
274
+ assigns(:checkout_type).should be_nil
275
275
  end
276
276
 
277
277
  it "should be forbidden" do