diff options
| author | Robert | 2017-06-21 14:52:46 +0200 |
|---|---|---|
| committer | Robert | 2017-06-22 09:05:19 +0200 |
| commit | d51985fc2a7c2138fd12cb9116ebf05d8b0e7dac (patch) | |
| tree | 678edcf8dc0c5f956e7969a6aaa1e77f35f73940 /spec/controllers/calendars_controller_spec.rb | |
| parent | 400898d14514aaf6df991dd2cb73e10b991ae34b (diff) | |
| download | chouette-core-d51985fc2a7c2138fd12cb9116ebf05d8b0e7dac.tar.bz2 | |
Refs: #3595@3h; fixing tests, evaluating timeliness gem :(
Diffstat (limited to 'spec/controllers/calendars_controller_spec.rb')
| -rw-r--r-- | spec/controllers/calendars_controller_spec.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/spec/controllers/calendars_controller_spec.rb b/spec/controllers/calendars_controller_spec.rb deleted file mode 100644 index ab3123192..000000000 --- a/spec/controllers/calendars_controller_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -RSpec.describe CalendarsController, type: :controller do - login_user - describe 'POST /create' do - - context 'legal date' do - let( :params ){ { - "calendar"=>{"name"=>"cal", "short_name"=>"cal", "shared"=>"false", - "date_values_attributes"=>{"1497892917360"=>{"value(3i)"=>"19", "value(2i)"=>"6", "value(1i)"=>"2017", "_destroy"=>""}}} - } } - - it 'creates the calendar and redirects to show' do - expect{ post :create, params }.to change{Calendar.count}.by 1 - expect( response ).to redirect_to( calendar_path( Calendar.last ) ) - end - end - - context 'illegal date' do - let( :params ){ { - "calendar"=>{"name"=>"cal", "short_name"=>"cal", "shared"=>"false", - "date_values_attributes"=>{"1497892917360"=>{"value(3i)"=>"31", "value(2i)"=>"6", "value(1i)"=>"2017", "_destroy"=>""}}} - } } - - it 'does not create the calendar and redircets to new' do - post :create, params - expect{ post :create, params }.not_to change{Calendar.count} - expect( response ).to redirect_to( new_calendar_path ) - end - end - - end -end |
