enju_event 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bfde966909ddbdc3638bf4dfc7341c4b19227ec
4
- data.tar.gz: c6a7699d6e39f5dda7e46fb38e1d0168bb9e45d0
3
+ metadata.gz: 4d99877025e7784515792d2b90083641c8ed0734
4
+ data.tar.gz: a9e75b8518656abb4123f3a12d080561b0d27ed8
5
5
  SHA512:
6
- metadata.gz: 45082771285e021a875d1cdcbb55edc7ff759138d23e4a6ad35f0fb7350efa097e68e32884a1616fb3825c243680e1238011205a2daa23c512f24b018f4c140b
7
- data.tar.gz: c64ed3911db46b3a4515cb1cb78454ba083e926ebec1b30d5df366a56805928c6dc3c03765ec6363453079df36182d86e0e5361c3572a74bba63cbec470a47cd
6
+ metadata.gz: 72473dec7be540b1eea074363a779b241df9a5eee314cc0a110ed593cb45d2e8f84340461fac52e86aaf30affd6bdd79e4190ca38cf041345b6c9bdbed81c3df
7
+ data.tar.gz: 4f173ff7046e4351f0ada781acbbc3748fd38533fa7b621b08bfcf99462952cf5addab78decc537098965f9092cbea92b37f430aec0846a2c0d1cfa6965473d8
@@ -16,6 +16,7 @@ class EventsController < ApplicationController
16
16
  query = query.gsub(' ', ' ')
17
17
  tag = params[:tag].to_s if params[:tag].present?
18
18
  date = params[:date].to_s if params[:date].present?
19
+ per_page = ( params[:format] == "json" ) ? 500 : Event.default_per_page
19
20
  mode = params[:mode]
20
21
 
21
22
  search = Sunspot.new_search(Event)
@@ -28,6 +29,10 @@ class EventsController < ApplicationController
28
29
  with(:start_at).less_than_or_equal_to Time.zone.parse(date)
29
30
  with(:end_at).greater_than Time.zone.parse(date)
30
31
  end
32
+ if params[:start].present? and params[:end].present?
33
+ with(:start_at).greater_than_or_equal_to Time.zone.parse(params[:start])
34
+ with(:end_at).less_than_or_equal_to Time.zone.parse(params[:end]).end_of_day
35
+ end
31
36
  case mode
32
37
  when 'upcoming'
33
38
  with(:start_at).greater_than Time.zone.now.beginning_of_day
@@ -38,14 +43,14 @@ class EventsController < ApplicationController
38
43
  end
39
44
 
40
45
  page = params[:page] || 1
41
- search.query.paginate(page.to_i, Event.default_per_page)
46
+ search.query.paginate(page.to_i, per_page)
42
47
  @events = search.execute!.results
43
48
  @count[:query_result] = @events.total_entries
44
49
 
45
50
  respond_to do |format|
46
51
  format.html # index.html.erb
47
52
  format.html.phone
48
- format.json
53
+ format.json { render json: @events.to_json }
49
54
  format.rss { render layout: false }
50
55
  format.txt
51
56
  format.atom
@@ -1,3 +1,3 @@
1
1
  module EnjuEvent
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -0,0 +1,9 @@
1
+ class EnjuEvent::UpdateGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+ desc "Create files for updating Next-L Enju"
4
+
5
+ def copy_migration_files
6
+ generate('statesman:add_constraints_to_most_recent', 'EventImportFile', 'EventImportFileTransition')
7
+ generate('statesman:add_constraints_to_most_recent', 'EventExportFile', 'EventExportFileTransition')
8
+ end
9
+ end
@@ -6,12 +6,12 @@ describe EventCategoriesController do
6
6
  disconnect_sunspot
7
7
 
8
8
  def valid_attributes
9
- FactoryGirl.attributes_for(:event_category)
9
+ FactoryBot.attributes_for(:event_category)
10
10
  end
11
11
 
12
12
  describe "GET index" do
13
13
  before(:each) do
14
- FactoryGirl.create(:event_category)
14
+ FactoryBot.create(:event_category)
15
15
  end
16
16
 
17
17
  describe "When logged in as Administrator" do
@@ -54,7 +54,7 @@ describe EventCategoriesController do
54
54
  login_fixture_admin
55
55
 
56
56
  it "assigns the requested event_category as @event_category" do
57
- event_category = FactoryGirl.create(:event_category)
57
+ event_category = FactoryBot.create(:event_category)
58
58
  get :show, id: event_category.id
59
59
  assigns(:event_category).should eq(event_category)
60
60
  end
@@ -64,7 +64,7 @@ describe EventCategoriesController do
64
64
  login_fixture_librarian
65
65
 
66
66
  it "assigns the requested event_category as @event_category" do
67
- event_category = FactoryGirl.create(:event_category)
67
+ event_category = FactoryBot.create(:event_category)
68
68
  get :show, id: event_category.id
69
69
  assigns(:event_category).should eq(event_category)
70
70
  end
@@ -74,7 +74,7 @@ describe EventCategoriesController do
74
74
  login_fixture_user
75
75
 
76
76
  it "assigns the requested event_category as @event_category" do
77
- event_category = FactoryGirl.create(:event_category)
77
+ event_category = FactoryBot.create(:event_category)
78
78
  get :show, id: event_category.id
79
79
  assigns(:event_category).should eq(event_category)
80
80
  end
@@ -82,7 +82,7 @@ describe EventCategoriesController do
82
82
 
83
83
  describe "When not logged in" do
84
84
  it "assigns the requested event_category as @event_category" do
85
- event_category = FactoryGirl.create(:event_category)
85
+ event_category = FactoryBot.create(:event_category)
86
86
  get :show, id: event_category.id
87
87
  assigns(:event_category).should eq(event_category)
88
88
  end
@@ -134,7 +134,7 @@ describe EventCategoriesController do
134
134
  login_fixture_admin
135
135
 
136
136
  it "assigns the requested event_category as @event_category" do
137
- event_category = FactoryGirl.create(:event_category)
137
+ event_category = FactoryBot.create(:event_category)
138
138
  get :edit, id: event_category.id
139
139
  assigns(:event_category).should eq(event_category)
140
140
  end
@@ -144,7 +144,7 @@ describe EventCategoriesController do
144
144
  login_fixture_librarian
145
145
 
146
146
  it "assigns the requested event_category as @event_category" do
147
- event_category = FactoryGirl.create(:event_category)
147
+ event_category = FactoryBot.create(:event_category)
148
148
  get :edit, id: event_category.id
149
149
  response.should be_forbidden
150
150
  end
@@ -154,7 +154,7 @@ describe EventCategoriesController do
154
154
  login_fixture_user
155
155
 
156
156
  it "assigns the requested event_category as @event_category" do
157
- event_category = FactoryGirl.create(:event_category)
157
+ event_category = FactoryBot.create(:event_category)
158
158
  get :edit, id: event_category.id
159
159
  response.should be_forbidden
160
160
  end
@@ -162,7 +162,7 @@ describe EventCategoriesController do
162
162
 
163
163
  describe "When not logged in" do
164
164
  it "should not assign the requested event_category as @event_category" do
165
- event_category = FactoryGirl.create(:event_category)
165
+ event_category = FactoryBot.create(:event_category)
166
166
  get :edit, id: event_category.id
167
167
  response.should redirect_to(new_user_session_url)
168
168
  end
@@ -288,7 +288,7 @@ describe EventCategoriesController do
288
288
 
289
289
  describe "PUT update" do
290
290
  before(:each) do
291
- @event_category = FactoryGirl.create(:event_category)
291
+ @event_category = FactoryBot.create(:event_category)
292
292
  @attrs = valid_attributes
293
293
  @invalid_attrs = {:name => ''}
294
294
  end
@@ -389,7 +389,7 @@ describe EventCategoriesController do
389
389
 
390
390
  describe "DELETE destroy" do
391
391
  before(:each) do
392
- @event_category = FactoryGirl.create(:event_category)
392
+ @event_category = FactoryBot.create(:event_category)
393
393
  end
394
394
 
395
395
  describe "When logged in as Administrator" do
@@ -9,7 +9,7 @@ describe EventsController do
9
9
  end
10
10
 
11
11
  before(:each) do
12
- FactoryGirl.create(:event)
12
+ FactoryBot.create(:event)
13
13
  end
14
14
 
15
15
  describe "When logged in as Administrator" do
@@ -78,6 +78,21 @@ describe EventsController do
78
78
  response.should be_success
79
79
  assigns(:events).should_not be_nil
80
80
  end
81
+
82
+ describe "with json data (calendar feed)" do
83
+ it "should get all events data" do
84
+ 20.times do |c|
85
+ FactoryBot.create(:event)
86
+ end
87
+ Event.reindex
88
+ today = Date.today
89
+ get :index, { format: "json", start: today.beginning_of_month.to_s, end: today.end_of_month.to_s }
90
+ expect(response).to be_success
91
+ events = assigns(:events)
92
+ expect(events).not_to be_nil
93
+ expect(events.size).to be >= 20
94
+ end
95
+ end
81
96
  end
82
97
  end
83
98
 
@@ -86,7 +101,7 @@ describe EventsController do
86
101
  login_fixture_admin
87
102
 
88
103
  it "assigns the requested event as @event" do
89
- event = FactoryGirl.create(:event)
104
+ event = FactoryBot.create(:event)
90
105
  get :show, :id => event.id
91
106
  assigns(:event).should eq(event)
92
107
  end
@@ -96,7 +111,7 @@ describe EventsController do
96
111
  login_fixture_librarian
97
112
 
98
113
  it "assigns the requested event as @event" do
99
- event = FactoryGirl.create(:event)
114
+ event = FactoryBot.create(:event)
100
115
  get :show, :id => event.id
101
116
  assigns(:event).should eq(event)
102
117
  end
@@ -106,7 +121,7 @@ describe EventsController do
106
121
  login_fixture_user
107
122
 
108
123
  it "assigns the requested event as @event" do
109
- event = FactoryGirl.create(:event)
124
+ event = FactoryBot.create(:event)
110
125
  get :show, :id => event.id
111
126
  assigns(:event).should eq(event)
112
127
  end
@@ -114,7 +129,7 @@ describe EventsController do
114
129
 
115
130
  describe "When not logged in" do
116
131
  it "assigns the requested event as @event" do
117
- event = FactoryGirl.create(:event)
132
+ event = FactoryBot.create(:event)
118
133
  get :show, :id => event.id
119
134
  assigns(:event).should eq(event)
120
135
  end
@@ -164,7 +179,7 @@ describe EventsController do
164
179
  login_fixture_admin
165
180
 
166
181
  it "assigns the requested event as @event" do
167
- event = FactoryGirl.create(:event)
182
+ event = FactoryBot.create(:event)
168
183
  get :edit, :id => event.id
169
184
  assigns(:event).should eq(event)
170
185
  end
@@ -174,7 +189,7 @@ describe EventsController do
174
189
  login_fixture_librarian
175
190
 
176
191
  it "assigns the requested event as @event" do
177
- event = FactoryGirl.create(:event)
192
+ event = FactoryBot.create(:event)
178
193
  get :edit, :id => event.id
179
194
  end
180
195
  end
@@ -183,7 +198,7 @@ describe EventsController do
183
198
  login_fixture_user
184
199
 
185
200
  it "assigns the requested event as @event" do
186
- event = FactoryGirl.create(:event)
201
+ event = FactoryBot.create(:event)
187
202
  get :edit, :id => event.id
188
203
  response.should be_forbidden
189
204
  end
@@ -191,7 +206,7 @@ describe EventsController do
191
206
 
192
207
  describe "When not logged in" do
193
208
  it "should not assign the requested event as @event" do
194
- event = FactoryGirl.create(:event)
209
+ event = FactoryBot.create(:event)
195
210
  get :edit, :id => event.id
196
211
  response.should redirect_to(new_user_session_url)
197
212
  end
@@ -200,7 +215,7 @@ describe EventsController do
200
215
 
201
216
  describe "POST create" do
202
217
  before(:each) do
203
- @attrs = FactoryGirl.attributes_for(:event)
218
+ @attrs = FactoryBot.attributes_for(:event)
204
219
  @invalid_attrs = {:name => ''}
205
220
  end
206
221
 
@@ -317,8 +332,8 @@ describe EventsController do
317
332
 
318
333
  describe "PUT update" do
319
334
  before(:each) do
320
- @event = FactoryGirl.create(:event)
321
- @attrs = FactoryGirl.attributes_for(:event)
335
+ @event = FactoryBot.create(:event)
336
+ @attrs = FactoryBot.attributes_for(:event)
322
337
  @invalid_attrs = {:name => ''}
323
338
  end
324
339
 
@@ -412,7 +427,7 @@ describe EventsController do
412
427
 
413
428
  describe "DELETE destroy" do
414
429
  before(:each) do
415
- @event = FactoryGirl.create(:event)
430
+ @event = FactoryBot.create(:event)
416
431
  end
417
432
 
418
433
  describe "When logged in as Administrator" do
@@ -6,7 +6,7 @@ describe ParticipatesController do
6
6
  disconnect_sunspot
7
7
 
8
8
  def valid_attributes
9
- FactoryGirl.attributes_for(:participate)
9
+ FactoryBot.attributes_for(:participate)
10
10
  end
11
11
 
12
12
  describe "GET index" do
@@ -50,7 +50,7 @@ describe ParticipatesController do
50
50
  login_fixture_admin
51
51
 
52
52
  it "assigns the requested participate as @participate" do
53
- participate = FactoryGirl.create(:participate)
53
+ participate = FactoryBot.create(:participate)
54
54
  get :show, id: participate.id
55
55
  assigns(:participate).should eq(participate)
56
56
  end
@@ -60,7 +60,7 @@ describe ParticipatesController do
60
60
  login_fixture_librarian
61
61
 
62
62
  it "assigns the requested participate as @participate" do
63
- participate = FactoryGirl.create(:participate)
63
+ participate = FactoryBot.create(:participate)
64
64
  get :show, id: participate.id
65
65
  assigns(:participate).should eq(participate)
66
66
  end
@@ -70,7 +70,7 @@ describe ParticipatesController do
70
70
  login_fixture_user
71
71
 
72
72
  it "assigns the requested participate as @participate" do
73
- participate = FactoryGirl.create(:participate)
73
+ participate = FactoryBot.create(:participate)
74
74
  get :show, id: participate.id
75
75
  assigns(:participate).should eq(participate)
76
76
  end
@@ -78,7 +78,7 @@ describe ParticipatesController do
78
78
 
79
79
  describe "When not logged in" do
80
80
  it "assigns the requested participate as @participate" do
81
- participate = FactoryGirl.create(:participate)
81
+ participate = FactoryBot.create(:participate)
82
82
  get :show, id: participate.id
83
83
  assigns(:participate).should eq(participate)
84
84
  end
@@ -128,7 +128,7 @@ describe ParticipatesController do
128
128
  login_fixture_admin
129
129
 
130
130
  it "assigns the requested participate as @participate" do
131
- participate = FactoryGirl.create(:participate)
131
+ participate = FactoryBot.create(:participate)
132
132
  get :edit, id: participate.id
133
133
  assigns(:participate).should eq(participate)
134
134
  end
@@ -138,7 +138,7 @@ describe ParticipatesController do
138
138
  login_fixture_librarian
139
139
 
140
140
  it "assigns the requested participate as @participate" do
141
- participate = FactoryGirl.create(:participate)
141
+ participate = FactoryBot.create(:participate)
142
142
  get :edit, id: participate.id
143
143
  assigns(:participate).should eq(participate)
144
144
  end
@@ -148,7 +148,7 @@ describe ParticipatesController do
148
148
  login_fixture_user
149
149
 
150
150
  it "assigns the requested participate as @participate" do
151
- participate = FactoryGirl.create(:participate)
151
+ participate = FactoryBot.create(:participate)
152
152
  get :edit, id: participate.id
153
153
  response.should be_forbidden
154
154
  end
@@ -156,7 +156,7 @@ describe ParticipatesController do
156
156
 
157
157
  describe "When not logged in" do
158
158
  it "should not assign the requested participate as @participate" do
159
- participate = FactoryGirl.create(:participate)
159
+ participate = FactoryBot.create(:participate)
160
160
  get :edit, id: participate.id
161
161
  response.should redirect_to(new_user_session_url)
162
162
  end
@@ -282,7 +282,7 @@ describe ParticipatesController do
282
282
 
283
283
  describe "PUT update" do
284
284
  before(:each) do
285
- @participate = FactoryGirl.create(:participate)
285
+ @participate = FactoryBot.create(:participate)
286
286
  @attrs = valid_attributes
287
287
  @invalid_attrs = {:event_id => ''}
288
288
  end
@@ -388,7 +388,7 @@ describe ParticipatesController do
388
388
 
389
389
  describe "DELETE destroy" do
390
390
  before(:each) do
391
- @participate = FactoryGirl.create(:participate)
391
+ @participate = FactoryBot.create(:participate)
392
392
  end
393
393
 
394
394
  describe "When logged in as Administrator" do
@@ -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 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
@@ -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: 20160814165332) do
14
+ ActiveRecord::Schema.define(version: 20171126135238) do
15
15
 
16
16
  create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
@@ -671,7 +671,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
671
671
  t.text "display_name"
672
672
  t.string "short_name", null: false
673
673
  t.text "my_networks"
674
- t.text "login_banner"
674
+ t.text "old_login_banner"
675
675
  t.text "note"
676
676
  t.integer "country_id"
677
677
  t.integer "position"
@@ -685,6 +685,10 @@ ActiveRecord::Schema.define(version: 20160814165332) do
685
685
  t.boolean "family_name_first", default: true
686
686
  t.integer "pub_year_facet_range_interval", default: 10
687
687
  t.integer "user_id"
688
+ t.string "header_logo_file_name"
689
+ t.string "header_logo_content_type"
690
+ t.integer "header_logo_file_size"
691
+ t.datetime "header_logo_updated_at"
688
692
  end
689
693
 
690
694
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :agent do |f|
3
3
  f.sequence(:full_name){|n| "full_name_#{n}"}
4
4
  f.agent_type_id{AgentType.where(name: 'person').first.id}
@@ -7,7 +7,7 @@ FactoryGirl.define do
7
7
  end
8
8
  end
9
9
 
10
- FactoryGirl.define do
10
+ FactoryBot.define do
11
11
  factory :invalid_agent, :class => Agent do |f|
12
12
  end
13
13
  end