Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalcic committed Oct 11, 2020
1 parent 3aad7e8 commit 495f8fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions test/models/spina/admin/conferences/event_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class EventTest < ActiveSupport::TestCase # rubocop:disable Metrics/ClassLength
end

test 'setting date updates start datetime' do
assert_changes '@event.start_datetime.inspect', to: @event.date.+(1.day).iso8601.inspect do
assert_changes '@event.start_datetime.inspect', to: @event.start_datetime.+(1.day).inspect do
@event.date = @event.date.+(1.day).iso8601
end
assert_changes '@event.start_datetime' do
Expand All @@ -158,7 +158,7 @@ class EventTest < ActiveSupport::TestCase # rubocop:disable Metrics/ClassLength
end

test 'setting start time updates start datetime' do
assert_changes '@event.start_datetime.inspect', to: @event.start_time.+(2.hours).inspect do
assert_changes '@event.start_datetime.inspect', to: @event.start_datetime.+(2.hours).at_beginning_of_minute.inspect do
@event.start_time = @event.start_time.+(2.hours).to_formatted_s(:time)
end
assert_changes '@event.start_datetime' do
Expand Down
2 changes: 1 addition & 1 deletion test/models/spina/admin/conferences/presentation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class PresentationTest < ActiveSupport::TestCase # rubocop:disable Metrics/Class
end

test 'setting date updates start datetime' do
assert_changes '@presentation.start_datetime.inspect', to: @presentation.date.+(1.day).inspect do
assert_changes '@presentation.start_datetime.inspect', to: @presentation.start_datetime.+(1.day).inspect do
@presentation.date = @presentation.date.+(1.day).iso8601
end
assert_changes '@presentation.start_datetime' do
Expand Down
30 changes: 15 additions & 15 deletions test/system/spina/admin/conferences/conferences_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class ConferencesTest < ApplicationSystemTestCase # rubocop:disable Metrics/Clas
within '.admin_conferences_event' do
click_link class: %w[button button-link icon]
within '#structure_form_pane_0' do
fill_in 'admin_conferences_conference_events_attributes_0_name', with: @conference.events.first.name
fill_in 'admin_conferences_conference_events_attributes_0_date', with: @conference.events.first.date
fill_in 'admin_conferences_conference_events_attributes_0_start_time', with: @conference.events.first.start_time
fill_in 'admin_conferences_conference_events_attributes_0_finish_time', with: @conference.events.first.finish_time
fill_in 'admin_conferences_conference_events_attributes_0_location', with: @conference.events.first.location
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_name/, with: @conference.events.first.name
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_date/, with: @conference.events.first.date
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_start_time/, with: @conference.events.first.start_time
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_finish_time/, with: @conference.events.first.finish_time
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_location/, with: @conference.events.first.location
find(class: 'horizontal-form-label', text: 'Description')
.sibling(class: 'horizontal-form-content').find('trix-editor')
.execute_script('this.editor.loadHTML(arguments[0])', @conference.events.first.description)
Expand All @@ -54,7 +54,7 @@ class ConferencesTest < ApplicationSystemTestCase # rubocop:disable Metrics/Clas
fill_in with: @conference.parts.find_by(name: 'submission_url').partable.content
end
within '[data-name="submission_email_address"]' do
fill_in with: @conference.parts.find_by(name: 'email_address').partable.content
fill_in with: @conference.parts.find_by(name: 'submission_email_address').partable.content
end
within '[data-name="submission_date"]' do
fill_in with: @conference.parts.find_by(name: 'submission_date').partable.content
Expand All @@ -74,11 +74,11 @@ class ConferencesTest < ApplicationSystemTestCase # rubocop:disable Metrics/Clas
within '[data-name="sponsors"]' do
click_link class: %w[button button-link]
within id: /structure_form_pane_[0-9]+/ do
fill_in id: /admin_conferences_conference_parts_attributes_5_partable_attributes_structure_items_attributes_[0-9]+
fill_in id: /admin_conferences_conference_parts_attributes_[0-9]_partable_attributes_structure_items_attributes_[0-9]+
_structure_parts_attributes_0_partable_attributes_content/x,
with: @conference.parts.find_by(name: 'sponsors').partable.structure_items.first.structure_parts.find_by(name: 'name')
.partable.content
fill_in id: /admin_conferences_conference_parts_attributes_5_partable_attributes_structure_items_attributes_[0-9]+
fill_in id: /admin_conferences_conference_parts_attributes_[0-9]_partable_attributes_structure_items_attributes_[0-9]+
_structure_parts_attributes_2_partable_attributes_content/x,
with: @conference.parts.find_by(name: 'sponsors').partable.structure_items.first.structure_parts
.find_by(name: 'website').partable.content
Expand Down Expand Up @@ -112,11 +112,11 @@ class ConferencesTest < ApplicationSystemTestCase # rubocop:disable Metrics/Clas
click_link href: '#structure_form_pane_1'
end
within '#structure_form_pane_1' do
fill_in 'admin_conferences_conference_events_attributes_1_name', with: @conference.events.first.name
fill_in 'admin_conferences_conference_events_attributes_1_date', with: @conference.events.first.date
fill_in 'admin_conferences_conference_events_attributes_1_start_time', with: @conference.events.first.start_time
fill_in 'admin_conferences_conference_events_attributes_1_finish_time', with: @conference.events.first.finish_time
fill_in 'admin_conferences_conference_events_attributes_1_location', with: @conference.events.first.location
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_name/, with: @conference.events.first.name
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_date/, with: @conference.events.first.date
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_start_time/, with: @conference.events.first.start_time
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_finish_time/, with: @conference.events.first.finish_time
fill_in id: /admin_conferences_conference_events_attributes_[0-9]_location/, with: @conference.events.first.location
find(class: 'horizontal-form-label', text: 'Description')
.sibling(class: 'horizontal-form-content').find('trix-editor')
.execute_script('this.editor.loadHTML(arguments[0])', @conference.events.first.description)
Expand Down Expand Up @@ -150,11 +150,11 @@ class ConferencesTest < ApplicationSystemTestCase # rubocop:disable Metrics/Clas
assert_no_selector '#overlay'
within '[data-name="sponsors"]' do
within id: /structure_form_pane_[0-9]+/ do
fill_in id: /admin_conferences_conference_parts_attributes_5_partable_attributes_structure_items_attributes_[0-9]+
fill_in id: /admin_conferences_conference_parts_attributes_[0-9]_partable_attributes_structure_items_attributes_[0-9]+
_structure_parts_attributes_0_partable_attributes_content/x,
with: @conference.parts.find_by(name: 'sponsors').partable.structure_items.first.structure_parts.find_by(name: 'name')
.partable.content
fill_in id: /admin_conferences_conference_parts_attributes_5_partable_attributes_structure_items_attributes_[0-9]+
fill_in id: /admin_conferences_conference_parts_attributes_[0-9]_partable_attributes_structure_items_attributes_[0-9]+
_structure_parts_attributes_2_partable_attributes_content/x,
with: @conference.parts.find_by(name: 'sponsors').partable.structure_items.first.structure_parts
.find_by(name: 'website').partable.content
Expand Down

0 comments on commit 495f8fd

Please sign in to comment.