enju_bookmark 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/bookmark_stat.rb +1 -1
  3. data/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
  4. data/lib/enju_bookmark/version.rb +1 -1
  5. data/spec/controllers/bookmark_stats_controller_spec.rb +13 -13
  6. data/spec/controllers/bookmarks_controller_spec.rb +7 -7
  7. data/spec/controllers/tags_controller_spec.rb +11 -11
  8. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  9. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  10. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  11. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  12. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  13. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  14. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  15. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  16. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  17. data/spec/dummy/db/schema.rb +11 -3
  18. data/spec/factories/bookmark.rb +2 -2
  19. data/spec/factories/bookmark_stat.rb +1 -1
  20. data/spec/factories/bookmark_stat_has_manifestation.rb +3 -3
  21. data/spec/factories/library.rb +2 -2
  22. data/spec/factories/manifestation.rb +1 -1
  23. data/spec/factories/profile.rb +2 -2
  24. data/spec/factories/tag.rb +1 -1
  25. data/spec/factories/user.rb +1 -1
  26. data/spec/models/bookmark_spec.rb +3 -3
  27. data/spec/models/user_spec.rb +2 -2
  28. data/spec/rails_helper.rb +3 -3
  29. data/spec/support/controller_macros.rb +3 -3
  30. metadata +23 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43b200d81f1cb303f3b686f898925995f1114152
4
- data.tar.gz: ed5980df4d50477ced0ae37659a9bdae7927b640
3
+ metadata.gz: 0c8a6178c8d4e0b7e1437ed9201cd6b937e8064c
4
+ data.tar.gz: 1b3754c7ebb25dea1bb8f8d6fbfda53ea9b7979e
5
5
  SHA512:
6
- metadata.gz: 024043757fadad79dbf1b7a50dabe264fb9dcab556261c240277bc4413cb41fca965a30c293c8667933a0320fc086958c83e39d9bb726219308b9161464206b3
7
- data.tar.gz: 3f10a7807401d3c43b91c37875ba4a368e812858bb5356ee586926568c3d4c51d76eefaeb83c22f251a9a9b8ee283c636cea984e2ad39038838cc5c62c2fa0eb
6
+ metadata.gz: b32e5e216313d4bc7408e67b42c1c341ed51733d3d9ff2221a19f401b37c00e1308776537d303b70b37ef331b7a2c7d61538e6de951f73b7a6f308b9636222ab
7
+ data.tar.gz: d5df204992e4fc76c7ac3e33c4ccbda2b189fbc0d099c6f6fa54064572a4b34a2c06d809aeed9f05a2cca918a2dc669b50ed1705d6447bf3adb6dd897052cf52
@@ -8,7 +8,7 @@ class BookmarkStat < ActiveRecord::Base
8
8
 
9
9
  paginates_per 10
10
10
 
11
- has_many :bookmark_stat_transitions
11
+ has_many :bookmark_stat_transitions, autosave: false
12
12
 
13
13
  def state_machine
14
14
  BookmarkStatStateMachine.new(self, transition_class: BookmarkStatTransition)
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForBookmarkStatTransitions < ActiveRecord::Migration
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :bookmark_stat_transitions, [:bookmark_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_bookmark_stat_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :bookmark_stat_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :bookmark_stat_transitions, name: "index_bookmark_stat_transitions_parent_most_recent"
11
+ change_column_null :bookmark_stat_transitions, :most_recent, true
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuBookmark
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -7,7 +7,7 @@ describe BookmarkStatsController do
7
7
 
8
8
  describe "GET index" do
9
9
  before(:each) do
10
- FactoryGirl.create(:bookmark_stat)
10
+ FactoryBot.create(:bookmark_stat)
11
11
  end
12
12
 
13
13
  describe "When logged in as Administrator" do
@@ -50,7 +50,7 @@ describe BookmarkStatsController do
50
50
  login_fixture_admin
51
51
 
52
52
  it "assigns the requested bookmark_stat as @bookmark_stat" do
53
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
53
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
54
54
  get :show, :id => bookmark_stat.id
55
55
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
56
56
  end
@@ -60,7 +60,7 @@ describe BookmarkStatsController do
60
60
  login_fixture_librarian
61
61
 
62
62
  it "assigns the requested bookmark_stat as @bookmark_stat" do
63
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
63
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
64
64
  get :show, :id => bookmark_stat.id
65
65
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
66
66
  end
@@ -70,7 +70,7 @@ describe BookmarkStatsController do
70
70
  login_fixture_user
71
71
 
72
72
  it "assigns the requested bookmark_stat as @bookmark_stat" do
73
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
73
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
74
74
  get :show, :id => bookmark_stat.id
75
75
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
76
76
  end
@@ -78,7 +78,7 @@ describe BookmarkStatsController do
78
78
 
79
79
  describe "When not logged in" do
80
80
  it "assigns the requested bookmark_stat as @bookmark_stat" do
81
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
81
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
82
82
  get :show, :id => bookmark_stat.id
83
83
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
84
84
  end
@@ -128,7 +128,7 @@ describe BookmarkStatsController do
128
128
  login_fixture_admin
129
129
 
130
130
  it "assigns the requested bookmark_stat as @bookmark_stat" do
131
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
131
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
132
132
  get :edit, :id => bookmark_stat.id
133
133
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
134
134
  end
@@ -138,7 +138,7 @@ describe BookmarkStatsController do
138
138
  login_fixture_librarian
139
139
 
140
140
  it "assigns the requested bookmark_stat as @bookmark_stat" do
141
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
141
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
142
142
  get :edit, :id => bookmark_stat.id
143
143
  expect(assigns(:bookmark_stat)).to eq(bookmark_stat)
144
144
  end
@@ -148,7 +148,7 @@ describe BookmarkStatsController do
148
148
  login_fixture_user
149
149
 
150
150
  it "assigns the requested bookmark_stat as @bookmark_stat" do
151
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
151
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
152
152
  get :edit, :id => bookmark_stat.id
153
153
  expect(response).to be_forbidden
154
154
  end
@@ -156,7 +156,7 @@ describe BookmarkStatsController do
156
156
 
157
157
  describe "When not logged in" do
158
158
  it "should not assign the requested bookmark_stat as @bookmark_stat" do
159
- bookmark_stat = FactoryGirl.create(:bookmark_stat)
159
+ bookmark_stat = FactoryBot.create(:bookmark_stat)
160
160
  get :edit, :id => bookmark_stat.id
161
161
  expect(response).to redirect_to(new_user_session_url)
162
162
  end
@@ -165,7 +165,7 @@ describe BookmarkStatsController do
165
165
 
166
166
  describe "POST create" do
167
167
  before(:each) do
168
- @attrs = FactoryGirl.attributes_for(:bookmark_stat)
168
+ @attrs = FactoryBot.attributes_for(:bookmark_stat)
169
169
  @invalid_attrs = {:start_date => ''}
170
170
  end
171
171
 
@@ -282,8 +282,8 @@ describe BookmarkStatsController do
282
282
 
283
283
  describe "PUT update" do
284
284
  before(:each) do
285
- @bookmark_stat = FactoryGirl.create(:bookmark_stat)
286
- @attrs = FactoryGirl.attributes_for(:bookmark_stat)
285
+ @bookmark_stat = FactoryBot.create(:bookmark_stat)
286
+ @attrs = FactoryBot.attributes_for(:bookmark_stat)
287
287
  @invalid_attrs = {:start_date => ''}
288
288
  end
289
289
 
@@ -383,7 +383,7 @@ describe BookmarkStatsController do
383
383
 
384
384
  describe "DELETE destroy" do
385
385
  before(:each) do
386
- @bookmark_stat = FactoryGirl.create(:bookmark_stat)
386
+ @bookmark_stat = FactoryBot.create(:bookmark_stat)
387
387
  end
388
388
 
389
389
  describe "When logged in as Administrator" do
@@ -77,7 +77,7 @@ describe BookmarksController do
77
77
  login_fixture_admin
78
78
 
79
79
  it "assigns the requested bookmark as @bookmark" do
80
- bookmark = FactoryGirl.create(:bookmark)
80
+ bookmark = FactoryBot.create(:bookmark)
81
81
  get :show, :id => bookmark.id
82
82
  expect(assigns(:bookmark)).to eq(bookmark)
83
83
  end
@@ -87,7 +87,7 @@ describe BookmarksController do
87
87
  login_fixture_librarian
88
88
 
89
89
  it "assigns the requested bookmark as @bookmark" do
90
- bookmark = FactoryGirl.create(:bookmark)
90
+ bookmark = FactoryBot.create(:bookmark)
91
91
  get :show, :id => bookmark.id
92
92
  expect(assigns(:bookmark)).to eq(bookmark)
93
93
  end
@@ -102,7 +102,7 @@ describe BookmarksController do
102
102
  login_fixture_user
103
103
 
104
104
  it "assigns the requested bookmark as @bookmark" do
105
- bookmark = FactoryGirl.create(:bookmark)
105
+ bookmark = FactoryBot.create(:bookmark)
106
106
  get :show, :id => bookmark.id
107
107
  expect(assigns(:bookmark)).to eq(bookmark)
108
108
  end
@@ -120,7 +120,7 @@ describe BookmarksController do
120
120
 
121
121
  describe "When not logged in" do
122
122
  it "assigns the requested bookmark as @bookmark" do
123
- bookmark = FactoryGirl.create(:bookmark)
123
+ bookmark = FactoryBot.create(:bookmark)
124
124
  get :show, :id => bookmark.id
125
125
  expect(assigns(:bookmark)).to eq(bookmark)
126
126
  expect(response).to redirect_to new_user_session_url
@@ -222,14 +222,14 @@ describe BookmarksController do
222
222
  describe "POST create" do
223
223
  before(:each) do
224
224
  @bookmark = bookmarks(:bookmark_00001)
225
- @attrs = FactoryGirl.attributes_for(:bookmark)
225
+ @attrs = FactoryBot.attributes_for(:bookmark)
226
226
  @invalid_attrs = {:url => ''}
227
227
  end
228
228
 
229
229
  describe "When logged in as User" do
230
230
  login_fixture_user
231
231
  # before(:each) do
232
- # @user = FactoryGirl.create(:user)
232
+ # @user = FactoryBot.create(:user)
233
233
  # sign_in @user
234
234
  # end
235
235
 
@@ -312,7 +312,7 @@ describe BookmarksController do
312
312
  describe "PUT update" do
313
313
  before(:each) do
314
314
  @bookmark = bookmarks(:bookmark_00001)
315
- @attrs = FactoryGirl.attributes_for(:bookmark)
315
+ @attrs = FactoryBot.attributes_for(:bookmark)
316
316
  @invalid_attrs = {:url => ''}
317
317
  end
318
318
 
@@ -48,7 +48,7 @@ describe TagsController do
48
48
  login_fixture_admin
49
49
 
50
50
  it "assigns the requested tag as @tag" do
51
- tag = FactoryGirl.create(:tag)
51
+ tag = FactoryBot.create(:tag)
52
52
  get :show, :id => tag.name
53
53
  expect(assigns(:tag)).to eq(tag)
54
54
  end
@@ -58,7 +58,7 @@ describe TagsController do
58
58
  login_fixture_librarian
59
59
 
60
60
  it "assigns the requested tag as @tag" do
61
- tag = FactoryGirl.create(:tag)
61
+ tag = FactoryBot.create(:tag)
62
62
  get :show, :id => tag.name
63
63
  expect(assigns(:tag)).to eq(tag)
64
64
  end
@@ -68,7 +68,7 @@ describe TagsController do
68
68
  login_fixture_user
69
69
 
70
70
  it "assigns the requested tag as @tag" do
71
- tag = FactoryGirl.create(:tag)
71
+ tag = FactoryBot.create(:tag)
72
72
  get :show, :id => tag.name
73
73
  expect(assigns(:tag)).to eq(tag)
74
74
  end
@@ -76,7 +76,7 @@ describe TagsController do
76
76
 
77
77
  describe "When not logged in" do
78
78
  it "assigns the requested tag as @tag" do
79
- tag = FactoryGirl.create(:tag)
79
+ tag = FactoryBot.create(:tag)
80
80
  get :show, :id => tag.name
81
81
  expect(assigns(:tag)).to eq(tag)
82
82
  end
@@ -88,7 +88,7 @@ describe TagsController do
88
88
  login_fixture_admin
89
89
 
90
90
  it "assigns the requested tag as @tag" do
91
- tag = FactoryGirl.create(:tag)
91
+ tag = FactoryBot.create(:tag)
92
92
  get :edit, :id => tag.name
93
93
  expect(assigns(:tag)).to eq(tag)
94
94
  end
@@ -98,7 +98,7 @@ describe TagsController do
98
98
  login_fixture_librarian
99
99
 
100
100
  it "assigns the requested tag as @tag" do
101
- tag = FactoryGirl.create(:tag)
101
+ tag = FactoryBot.create(:tag)
102
102
  get :edit, :id => tag.name
103
103
  expect(assigns(:tag)).to eq(tag)
104
104
  end
@@ -108,7 +108,7 @@ describe TagsController do
108
108
  login_fixture_user
109
109
 
110
110
  it "assigns the requested tag as @tag" do
111
- tag = FactoryGirl.create(:tag)
111
+ tag = FactoryBot.create(:tag)
112
112
  get :edit, :id => tag.name
113
113
  expect(response).to be_forbidden
114
114
  end
@@ -116,7 +116,7 @@ describe TagsController do
116
116
 
117
117
  describe "When not logged in" do
118
118
  it "should not assign the requested tag as @tag" do
119
- tag = FactoryGirl.create(:tag)
119
+ tag = FactoryBot.create(:tag)
120
120
  get :edit, :id => tag.name
121
121
  expect(response).to redirect_to(new_user_session_url)
122
122
  end
@@ -125,8 +125,8 @@ describe TagsController do
125
125
 
126
126
  describe "PUT update" do
127
127
  before(:each) do
128
- @tag = FactoryGirl.create(:tag)
129
- @attrs = FactoryGirl.attributes_for(:tag)
128
+ @tag = FactoryBot.create(:tag)
129
+ @attrs = FactoryBot.attributes_for(:tag)
130
130
  @invalid_attrs = {:name => ''}
131
131
  end
132
132
 
@@ -231,7 +231,7 @@ describe TagsController do
231
231
 
232
232
  describe "DELETE destroy" do
233
233
  before(:each) do
234
- @tag = FactoryGirl.create(:tag)
234
+ @tag = FactoryBot.create(:tag)
235
235
  end
236
236
 
237
237
  describe "When logged in as Administrator" do
@@ -8,7 +8,7 @@ class AddDcndlSchema < ActiveRecord::Migration
8
8
  add_column :manifestations, :valid_until, :timestamp
9
9
  add_column :manifestations, :date_submitted, :timestamp
10
10
  add_column :manifestations, :date_accepted, :timestamp
11
- add_column :manifestations, :date_caputured, :timestamp
11
+ add_column :manifestations, :date_captured, :timestamp
12
12
  rename_column :manifestations, :copyright_date, :date_copyrighted
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ class AddDcndlSchema < ActiveRecord::Migration
21
21
  remove_column :manifestations, :valid_until
22
22
  remove_column :manifestations, :date_submitted
23
23
  remove_column :manifestations, :date_accepted
24
- remove_column :manifestations, :date_caputured
24
+ remove_column :manifestations, :date_captured
25
25
  rename_column :manifestations, :date_copyrighted, :copyright_date
26
26
  end
27
27
  end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToItemsReferencingManifestations < ActiveRecord::Migration
2
+ def change
3
+ add_foreign_key :items, :manifestations
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddProfileIdToAgent < ActiveRecord::Migration
2
+ def change
3
+ add_column :agents, :profile_id, :integer
4
+ add_index :agents, :profile_id
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :csv_charset_conversion, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_attachment :library_groups, :header_logo
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration
2
+ def change
3
+ change_column_null :items, :manifestation_id, false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration
2
+ def change
3
+ rename_column :library_groups, :login_banner, :old_login_banner
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration
2
+ def change
3
+ add_foreign_key :libraries, :library_groups, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :header_logo_meta, :text
4
+ end
5
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20160820004638) do
14
+ ActiveRecord::Schema.define(version: 20180102162311) do
15
15
 
16
16
  create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
@@ -160,12 +160,14 @@ ActiveRecord::Schema.define(version: 20160820004638) do
160
160
  t.string "birth_date"
161
161
  t.string "death_date"
162
162
  t.string "agent_identifier"
163
+ t.integer "profile_id"
163
164
  end
164
165
 
165
166
  add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
166
167
  add_index "agents", ["country_id"], name: "index_agents_on_country_id"
167
168
  add_index "agents", ["full_name"], name: "index_agents_on_full_name"
168
169
  add_index "agents", ["language_id"], name: "index_agents_on_language_id"
170
+ add_index "agents", ["profile_id"], name: "index_agents_on_profile_id"
169
171
  add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
170
172
 
171
173
  create_table "baskets", force: :cascade do |t|
@@ -615,7 +617,7 @@ ActiveRecord::Schema.define(version: 20160820004638) do
615
617
  t.string "binding_item_identifier"
616
618
  t.string "binding_call_number"
617
619
  t.datetime "binded_at"
618
- t.integer "manifestation_id"
620
+ t.integer "manifestation_id", null: false
619
621
  end
620
622
 
621
623
  add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
@@ -705,7 +707,7 @@ ActiveRecord::Schema.define(version: 20160820004638) do
705
707
  t.text "display_name"
706
708
  t.string "short_name", null: false
707
709
  t.text "my_networks"
708
- t.text "login_banner"
710
+ t.text "old_login_banner"
709
711
  t.text "note"
710
712
  t.integer "country_id"
711
713
  t.integer "position"
@@ -720,6 +722,12 @@ ActiveRecord::Schema.define(version: 20160820004638) do
720
722
  t.boolean "family_name_first", default: true
721
723
  t.integer "pub_year_facet_range_interval", default: 10
722
724
  t.integer "user_id"
725
+ t.string "header_logo_file_name"
726
+ t.string "header_logo_content_type"
727
+ t.integer "header_logo_file_size"
728
+ t.datetime "header_logo_updated_at"
729
+ t.boolean "csv_charset_conversion", default: false, null: false
730
+ t.text "header_logo_meta"
723
731
  end
724
732
 
725
733
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
@@ -1,7 +1,7 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :bookmark do |f|
3
3
  f.sequence(:title){|n| "bookmark_#{n}"}
4
4
  f.sequence(:url){|n| "http://example.jp/#{n}"}
5
- f.user_id{FactoryGirl.create(:user).id}
5
+ f.user_id{FactoryBot.create(:user).id}
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :bookmark_stat do |f|
3
3
  f.start_date 1.week.ago
4
4
  f.end_date 1.day.ago
@@ -1,6 +1,6 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :bookmark_stat_has_manifestation do |f|
3
- f.bookmark_stat_id{FactoryGirl.create(:bookmark_stat).id}
4
- f.manifestation_id{FactoryGirl.create(:manifestation).id}
3
+ f.bookmark_stat_id{FactoryBot.create(:bookmark_stat).id}
4
+ f.manifestation_id{FactoryBot.create(:manifestation).id}
5
5
  end
6
6
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :library do |f|
3
3
  f.sequence(:name){|n| "library#{n}"}
4
4
  f.sequence(:short_display_name){|n| "library_#{n}"}
@@ -6,7 +6,7 @@ FactoryGirl.define do
6
6
  end
7
7
  end
8
8
 
9
- FactoryGirl.define do
9
+ FactoryBot.define do
10
10
  factory :invalid_library, :class => Library do |f|
11
11
  f.library_group_id{LibraryGroup.first.id}
12
12
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :manifestation do |f|
3
3
  f.sequence(:original_title){|n| "manifestation_title_#{n}"}
4
4
  f.carrier_type_id{CarrierType.find(1).id}
@@ -1,10 +1,10 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :profile, :class => Profile do |f|
3
3
  f.user_group_id {UserGroup.first.id}
4
4
  f.required_role_id {Role.where(name: 'User').first.id}
5
5
  f.sequence(:user_number){|n| "user_number_#{n}"}
6
6
  f.library_id 2
7
7
  f.locale "ja"
8
- f.user_id {FactoryGirl.create(:user).id}
8
+ f.user_id {FactoryBot.create(:user).id}
9
9
  end
10
10
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :tag do |f|
3
3
  f.sequence(:name){|n| "tag_#{n}"}
4
4
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :admin, :class => User do |f|
3
3
  f.sequence(:username){|n| "admin_#{n}"}
4
4
  f.sequence(:email){|n| "admin_#{n}@example.jp"}
@@ -13,7 +13,7 @@ describe Bookmark do
13
13
  old_manifestation_count = Manifestation.count
14
14
  old_item_count = Item.count
15
15
  lambda{
16
- bookmark = FactoryGirl.create(:user).bookmarks.create(:url => 'http://www.example.com/', :title => 'test')
16
+ bookmark = FactoryBot.create(:user).bookmarks.create(:url => 'http://www.example.com/', :title => 'test')
17
17
  }.should change(Bookmark, :count)
18
18
  Manifestation.count.should eq old_manifestation_count + 1
19
19
  Item.count.should eq old_item_count + 1
@@ -23,7 +23,7 @@ describe Bookmark do
23
23
  old_manifestation_count = Manifestation.count
24
24
  old_item_count = Item.count
25
25
  lambda{
26
- bookmark = FactoryGirl.create(:user).bookmarks.create(:url => "#{LibraryGroup.site_config.url}manifestations/1", :title => 'test')
26
+ bookmark = FactoryBot.create(:user).bookmarks.create(:url => "#{LibraryGroup.site_config.url}manifestations/1", :title => 'test')
27
27
  }.should change(Bookmark, :count)
28
28
  assert_equal old_manifestation_count, Manifestation.count
29
29
  assert_equal old_item_count, Item.count
@@ -33,7 +33,7 @@ describe Bookmark do
33
33
  old_manifestation_count = Manifestation.count
34
34
  old_item_count = Item.count
35
35
  lambda{
36
- bookmark = FactoryGirl.create(:user).bookmarks.create(:url => "#{LibraryGroup.site_config.url}libraries/1", :title => 'test')
36
+ bookmark = FactoryBot.create(:user).bookmarks.create(:url => "#{LibraryGroup.site_config.url}libraries/1", :title => 'test')
37
37
  }.should_not change(Bookmark, :count)
38
38
  assert_equal old_manifestation_count, Manifestation.count
39
39
  assert_equal old_item_count, Item.count
@@ -13,8 +13,8 @@ describe User do
13
13
  end
14
14
 
15
15
  it "should export share_bookmarks" do
16
- user = FactoryGirl.create(:user,
17
- profile: FactoryGirl.create(:profile,
16
+ user = FactoryBot.create(:user,
17
+ profile: FactoryBot.create(:profile,
18
18
  share_bookmarks: true))
19
19
  lines = User.export
20
20
  rows = CSV.new(lines, col_sep: "\t", headers: true)
@@ -7,7 +7,7 @@ Coveralls.wear!
7
7
  ENV["RAILS_ENV"] ||= 'test'
8
8
  require File.expand_path("../dummy/config/environment", __FILE__)
9
9
  require 'rspec/rails'
10
- require 'factory_girl'
10
+ require 'factory_bot'
11
11
  require 'sunspot-rails-tester'
12
12
 
13
13
  # Requires supporting ruby files with custom matchers and macros, etc,
@@ -49,5 +49,5 @@ RSpec.configure do |config|
49
49
  config.infer_spec_type_from_file_location!
50
50
  end
51
51
 
52
- FactoryGirl.definition_file_paths << "#{::Rails.root}/../../spec/factories"
53
- FactoryGirl.find_definitions
52
+ FactoryBot.definition_file_paths << "#{::Rails.root}/../../spec/factories"
53
+ FactoryBot.find_definitions
@@ -2,14 +2,14 @@ module ControllerMacros
2
2
  def login_admin
3
3
  before(:each) do
4
4
  @request.env["devise.mapping"] = Devise.mappings[:admin]
5
- sign_in FactoryGirl.create(:admin)
5
+ sign_in FactoryBot.create(:admin)
6
6
  end
7
7
  end
8
8
 
9
9
  def login_librarian
10
10
  before(:each) do
11
11
  @request.env["devise.mapping"] = Devise.mappings[:user]
12
- user = FactoryGirl.create(:librarian)
12
+ user = FactoryBot.create(:librarian)
13
13
  sign_in user
14
14
  end
15
15
  end
@@ -17,7 +17,7 @@ module ControllerMacros
17
17
  def login_user
18
18
  before(:each) do
19
19
  @request.env["devise.mapping"] = Devise.mappings[:user]
20
- user = FactoryGirl.create(:user)
20
+ user = FactoryBot.create(:user)
21
21
  sign_in user
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_bookmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2018-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_biblio
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.3
19
+ version: 0.2.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.3
26
+ version: 0.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: acts-as-taggable-on
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.5'
111
111
  - !ruby/object:Gem::Dependency
112
- name: factory_girl_rails
112
+ name: factory_bot_rails
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -239,6 +239,7 @@ files:
239
239
  - db/migrate/20141013152012_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
240
240
  - db/migrate/20141013152013_add_missing_taggable_index.acts_as_taggable_on_engine.rb
241
241
  - db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb
242
+ - db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb
242
243
  - lib/enju_bookmark.rb
243
244
  - lib/enju_bookmark/bookmark_helper.rb
244
245
  - lib/enju_bookmark/bookmark_url.rb
@@ -480,10 +481,12 @@ files:
480
481
  - spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb
481
482
  - spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb
482
483
  - spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb
484
+ - spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb
483
485
  - spec/dummy/db/migrate/20150124152756_add_foreign_key_to_shelves_referencing_libraries.rb
484
486
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
485
487
  - spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
486
488
  - spec/dummy/db/migrate/20150924115059_create_withdraws.rb
489
+ - spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb
487
490
  - spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
488
491
  - spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
489
492
  - spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb
@@ -501,6 +504,12 @@ files:
501
504
  - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
502
505
  - spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb
503
506
  - spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb
507
+ - spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb
508
+ - spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb
509
+ - spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb
510
+ - spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb
511
+ - spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb
512
+ - spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb
504
513
  - spec/dummy/db/schema.rb
505
514
  - spec/dummy/public/404.html
506
515
  - spec/dummy/public/422.html
@@ -564,7 +573,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
564
573
  version: '0'
565
574
  requirements: []
566
575
  rubyforge_project:
567
- rubygems_version: 2.5.2.1
576
+ rubygems_version: 2.6.14
568
577
  signing_key:
569
578
  specification_version: 4
570
579
  summary: enju_bookmark plugin
@@ -605,6 +614,7 @@ test_files:
605
614
  - spec/dummy/public/500.html
606
615
  - spec/dummy/public/404.html
607
616
  - spec/dummy/db/schema.rb
617
+ - spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb
608
618
  - spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb
609
619
  - spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb
610
620
  - spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb
@@ -632,11 +642,13 @@ test_files:
632
642
  - spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb
633
643
  - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
634
644
  - spec/dummy/db/migrate/20081030023412_create_checkout_types.rb
645
+ - spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb
635
646
  - spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb
636
647
  - spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb
637
648
  - spec/dummy/db/migrate/015_create_creates.rb
638
649
  - spec/dummy/db/migrate/20081025083905_create_languages.rb
639
650
  - spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb
651
+ - spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb
640
652
  - spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb
641
653
  - spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb
642
654
  - spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb
@@ -657,6 +669,7 @@ test_files:
657
669
  - spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb
658
670
  - spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb
659
671
  - spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb
672
+ - spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb
660
673
  - spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb
661
674
  - spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb
662
675
  - spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb
@@ -719,6 +732,8 @@ test_files:
719
732
  - spec/dummy/db/migrate/125_create_donates.rb
720
733
  - spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb
721
734
  - spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb
735
+ - spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb
736
+ - spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb
722
737
  - spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb
723
738
  - spec/dummy/db/migrate/154_create_messages.rb
724
739
  - spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb
@@ -732,6 +747,7 @@ test_files:
732
747
  - spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb
733
748
  - spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb
734
749
  - spec/dummy/db/migrate/041_create_roles.rb
750
+ - spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb
735
751
  - spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb
736
752
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
737
753
  - spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb
@@ -746,6 +762,7 @@ test_files:
746
762
  - spec/dummy/db/migrate/20111124110059_create_create_types.rb
747
763
  - spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb
748
764
  - spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb
765
+ - spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb
749
766
  - spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb
750
767
  - spec/dummy/db/migrate/20081027150907_create_picture_files.rb
751
768
  - spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb