Skip to content

Commit

Permalink
fix cucumber errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Florence-Njeri committed Feb 20, 2023
1 parent 28e81c6 commit a5bbb20
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions features/step_definitions/event_steps.rb
Expand Up @@ -45,12 +45,9 @@
end

Given('following events exist:') do |table|
table.map_column('start_datetime') do |date|
date = Time.current.strftime('%c') if date == 'TODAYS_DATE'
date
end
table.hashes.each do |hash|
hash[:project_id] = Project.find_by(title: hash['project']).id unless hash['project'].blank?
hash[:start_datetime] = Time.current.strftime('%c') if hash[:start_datetime] == 'TODAYS_DATE'
hash.delete('project')
hash[:repeat_ends] = false
create(:event, hash)
Expand Down Expand Up @@ -270,8 +267,8 @@ def stub_user_browser_to_specific_timezone
stub_user_browser_to_specific_timezone
@start_date = find('#start_date').value
@start_time = find('#start_time').value
expect(@start_date).to eq @tz.utc_to_local(@event.start_datetime).to_date.strftime('%Y-%m-%d')
expect(@start_time).to eq @tz.utc_to_local(@event.start_datetime).to_time.strftime('%I:%M %p')
expect(@start_date).to eq @tz.utc_to_local(@event.start_datetime).strftime('%Y-%m-%d')
expect(@start_time).to eq @tz.utc_to_local(@event.start_datetime).strftime('%I:%M %p')
end

Given(/^an existing event$/) do
Expand Down

0 comments on commit a5bbb20

Please sign in to comment.