Workshop interest
This commit is contained in:
@@ -5,6 +5,7 @@ Feature: Registration Page
|
||||
Scenario: Start registration from landing page
|
||||
Given There is an upcoming conference in Halifax NS
|
||||
And Registration is open
|
||||
And a workshop titled My Awesome Workshop exists
|
||||
And I am on the landing page
|
||||
|
||||
Then I see the Bike!Bike! logo
|
||||
@@ -110,6 +111,39 @@ Feature: Registration Page
|
||||
And I should not see My Workshop Title
|
||||
And I should not see Super Awesome Workshop
|
||||
|
||||
Scenario: Be the first to like a workshop
|
||||
Given There is an upcoming conference in Guadalajara Mexico
|
||||
And Registration is open
|
||||
And I am logged in as somebody@bikebike.org
|
||||
And My name is John Doe
|
||||
And I am registered for the conference
|
||||
And a workshop exists
|
||||
And I view the workshop
|
||||
|
||||
Then I should see No one is interested
|
||||
Then click on toggle_interest button
|
||||
Then I should see You are interested
|
||||
|
||||
Then I click on toggle_interest button
|
||||
Then I should see No one is interested
|
||||
|
||||
Scenario: Like a workshop
|
||||
Given There is an upcoming conference in Guadalajara Mexico
|
||||
And Registration is open
|
||||
And I am logged in as somebody@bikebike.org
|
||||
And My name is John Doe
|
||||
And I am registered for the conference
|
||||
And a workshop exists
|
||||
And 4 people are interested in the workshop
|
||||
And I view the workshop
|
||||
|
||||
Then I should see 4 people are interested
|
||||
Then click on toggle_interest button
|
||||
Then I should see You and 4 others are interested
|
||||
|
||||
Then I click on toggle_interest button
|
||||
Then I should see 4 people are interested
|
||||
|
||||
Scenario: Broadcast message
|
||||
Given There is an upcoming conference in San Marcos TX
|
||||
And Registration is open
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
require 'forgery'
|
||||
|
||||
Given(/^(I )?(am on |visit )the (.+) page$/) do |a, b, page_name|
|
||||
visit path_to(page_name)
|
||||
end
|
||||
@@ -96,6 +98,21 @@ Given(/^an organization( named .+)? exists( in .+)?$/) do |name, location|
|
||||
end
|
||||
end
|
||||
|
||||
Given(/^a workshop( titled .+)? exists?$/) do |title|
|
||||
workshop = Workshop.new
|
||||
workshop.conference_id = @last_conference.id
|
||||
workshop.title = title ? title.gsub(/^\s*titled\s*(.*?)\s*$/, '\1') : Forgery::LoremIpsum.sentence({:random => true}).gsub(/\.$/, '').titlecase
|
||||
workshop.info = Forgery::LoremIpsum.paragraph({:random => true})
|
||||
workshop.save
|
||||
@last_workshop = workshop
|
||||
end
|
||||
|
||||
Given(/^(\d+) (person is|people are) interested in the workshop$/) do |interested,a|
|
||||
(1..interested.to_i).each do |i|
|
||||
WorkshopInterest.create(workshop_id: @last_workshop.id, user_id: (@my_account ? @my_account.id + 1 : 1000) + i)
|
||||
end
|
||||
end
|
||||
|
||||
Given(/^Registration is (open|closed)$/) do |status|
|
||||
@last_conference.registration_open = (status == 'open')
|
||||
@last_conference.save!
|
||||
|
||||
Reference in New Issue
Block a user