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.
@@ -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
@@ -6,6 +6,7 @@ require 'factory_girl_rails'
6
6
  require 'database_cleaner'
7
7
  require 'capybara/rails'
8
8
  require 'capybara/rspec'
9
+ require 'pry-rails'
9
10
 
10
11
  Rails.backtrace_cleaner.remove_silencers!
11
12
 
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.3.3
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-09-26 00:00:00.000000000 Z
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