Browse Source

Added conference detail capturing to tests

development
Godwin 7 years ago
parent
commit
86abef7215
  1. 10
      features/conferences.feature
  2. 6
      features/step_definitions/conferences.rb
  3. 1
      features/step_definitions/interface_steps.rb

10
features/conferences.feature

@ -55,6 +55,16 @@ Feature: Conferences
Given there is an upcoming regional conference in 'Yellowknife'
And a past conference in 'New Orleans'
And an upcoming conference in 'Brooklyn NY'
And the conference has payment message copy
And the conference has group ride info copy
And the conference has housing info copy
And the conference has workshop info copy
And the conference has schedule info copy
And the conference has travel info copy
And the conference has city info copy
And the conference has what to bring copy
And the conference has volunteering info copy
And the conference has additional details copy
And I am on the conference page
Then I should see 'Brooklyn'

6
features/step_definitions/conferences.rb

@ -49,6 +49,12 @@ Given /^the conference accepts paypal$/i do
TestState.last_conference.save!
end
Given /^the conference has (.+) copy$/i do |field|
copy = Forgery::LoremIpsum.paragraphs(rand(1..4), sentences: rand(1..3), random: true, html: html)
TestState.last_conference.send("#{field.gsub(/\s+/, '_')}=", copy)
TestState.last_conference.save!
end
Then /^I am( not)? a member of (.+)$/i do |state, org_name|
user = nil
should_be = !(state =~ / not/)

1
features/step_definitions/interface_steps.rb

@ -95,7 +95,6 @@ Then /^(?:I )?enter (?:my |an? |some |the )?(.+?)(?: as '(.+)')?$/i do |field, v
html = false
if element.tag_name.to_s.downcase == 'div'
element = element.first('[contenteditable]')
html = true
end
unless value.present?

Loading…
Cancel
Save