hot_date_rails 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/form_helper.rb +34 -32
- data/db/migrate/20141101193750_add_time_of_date_to_schedules.rb +5 -0
- data/lib/hot_date_rails/utils.rb +11 -0
- data/lib/hot_date_rails/version.rb +1 -1
- data/lib/hot_date_rails.rb +1 -0
- data/spec/dummy/app/controllers/schedules_controller.rb +1 -1
- data/spec/dummy/app/views/schedules/_form.html.erb +6 -6
- data/spec/dummy/app/views/schedules/_form_custom.html.erb +16 -8
- data/spec/dummy/app/views/schedules/edit_custom.html.erb +3 -0
- data/spec/dummy/config/locales/en.yml +9 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141031221232_add_date_in_time_to_schedules.rb +5 -0
- data/spec/dummy/db/schema.rb +3 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +540 -0
- data/spec/dummy/log/test.log +17291 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/376c6e8b4ac8bf2405dcf785b93a82d4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/89aa62e587867525e04ef35f65a406a7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/requests/datetime_picker_spec.rb +32 -0
- data/spec/spec_helper.rb +1 -0
- metadata +8 -2
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -58,4 +58,36 @@ RSpec.describe "Datetime Picker", :type => :request do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
61
|
+
|
62
|
+
describe "specify jQuery widget class name", :js => true do
|
63
|
+
before { visit '/custom_schedules/new' }
|
64
|
+
describe "just date" do
|
65
|
+
it "shows just the date and only the date" do
|
66
|
+
find("#date_in_time").click
|
67
|
+
page.should have_selector("table.ui-datepicker-calendar")
|
68
|
+
page.should_not have_selector("div.ui-timepicker-div")
|
69
|
+
end
|
70
|
+
it "shows the date that we chose in the correct localized format" do
|
71
|
+
@curr_date = Time.now
|
72
|
+
@schedule = FactoryGirl.create(:schedule, date_in_time: @curr_date.to_date)
|
73
|
+
visit "/custom_schedules\/#{@schedule.id}\/edit"
|
74
|
+
find("#date_in_time").value.should eq I18n.localize(@curr_date.to_date)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "just time" do
|
79
|
+
it "shows just the time and only the time" do
|
80
|
+
find("#time_of_date").click
|
81
|
+
page.should have_selector("div.ui-timepicker-div")
|
82
|
+
page.should_not have_selector("table.ui-datepicker-calendar")
|
83
|
+
end
|
84
|
+
it "shows the date that we chose in the correct localized format" do
|
85
|
+
@curr_date = Time.now
|
86
|
+
@schedule = FactoryGirl.create(:schedule, time_of_date: @curr_date)
|
87
|
+
visit "/custom_schedules\/#{@schedule.id}\/edit"
|
88
|
+
find("#time_of_date").value.should eq @curr_date.strftime("%H:%M")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
61
93
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot_date_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John O'Malley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -174,8 +174,10 @@ files:
|
|
174
174
|
- config/initializers/hot_date_rails.rb
|
175
175
|
- config/locales/en.yml
|
176
176
|
- config/routes.rb
|
177
|
+
- db/migrate/20141101193750_add_time_of_date_to_schedules.rb
|
177
178
|
- lib/hot_date_rails.rb
|
178
179
|
- lib/hot_date_rails/engine.rb
|
180
|
+
- lib/hot_date_rails/utils.rb
|
179
181
|
- lib/hot_date_rails/version.rb
|
180
182
|
- lib/tasks/hot_date_rails_tasks.rake
|
181
183
|
- spec/dummy/README.rdoc
|
@@ -190,6 +192,7 @@ files:
|
|
190
192
|
- spec/dummy/app/views/schedules/_form.html.erb
|
191
193
|
- spec/dummy/app/views/schedules/_form_custom.html.erb
|
192
194
|
- spec/dummy/app/views/schedules/edit.html.erb
|
195
|
+
- spec/dummy/app/views/schedules/edit_custom.html.erb
|
193
196
|
- spec/dummy/app/views/schedules/new.html.erb
|
194
197
|
- spec/dummy/app/views/schedules/new_custom.html.erb
|
195
198
|
- spec/dummy/bin/bundle
|
@@ -218,6 +221,7 @@ files:
|
|
218
221
|
- spec/dummy/db/migrate/20140827212211_create_schedules.rb
|
219
222
|
- spec/dummy/db/migrate/20140904013919_add_more_time_cols_to_schedules.rb
|
220
223
|
- spec/dummy/db/migrate/20140909013705_add_easter_to_schedules.rb
|
224
|
+
- spec/dummy/db/migrate/20141031221232_add_date_in_time_to_schedules.rb
|
221
225
|
- spec/dummy/db/production.sqlite3
|
222
226
|
- spec/dummy/db/schema.rb
|
223
227
|
- spec/dummy/db/test.sqlite3
|
@@ -624,6 +628,7 @@ test_files:
|
|
624
628
|
- spec/dummy/app/views/schedules/_form.html.erb
|
625
629
|
- spec/dummy/app/views/schedules/_form_custom.html.erb
|
626
630
|
- spec/dummy/app/views/schedules/edit.html.erb
|
631
|
+
- spec/dummy/app/views/schedules/edit_custom.html.erb
|
627
632
|
- spec/dummy/app/views/schedules/new.html.erb
|
628
633
|
- spec/dummy/app/views/schedules/new_custom.html.erb
|
629
634
|
- spec/dummy/bin/bundle
|
@@ -652,6 +657,7 @@ test_files:
|
|
652
657
|
- spec/dummy/db/migrate/20140827212211_create_schedules.rb
|
653
658
|
- spec/dummy/db/migrate/20140904013919_add_more_time_cols_to_schedules.rb
|
654
659
|
- spec/dummy/db/migrate/20140909013705_add_easter_to_schedules.rb
|
660
|
+
- spec/dummy/db/migrate/20141031221232_add_date_in_time_to_schedules.rb
|
655
661
|
- spec/dummy/db/production.sqlite3
|
656
662
|
- spec/dummy/db/schema.rb
|
657
663
|
- spec/dummy/db/test.sqlite3
|