Sha256: 526092eb243eec388b14087dc4f908acd91fc3b4ccf845e0df6aa422859e00af

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

Given /^I am interested in a proposal for a "([^\"]*)" event$/ do |kind|
  # TODO rework fixtures to use automatic identities
  #@event = Event.find(Fixtures.identify(kind))
  event_id = \
    case kind
    when "open" then 2009
    when "closed" then 1975
    else raise ArgumentError, "Unknown event_id: #{kind}"
    end

  # Set flags on event to prevent redirections
  @event = Event.find(event_id)
  @event.proposal_status_published = false
  @event.schedule_published = false
  @event.save!

  @proposal = @event.proposals.first
end

Given /^the settings allow comments after the deadline: "([^\"]*)"$/ do |truth|
  unless truth.blank?
    SETTINGS.have_event_proposal_comments_after_deadline = boolean_for(truth)
  end
end

Given /^the event is accepting comments if after the deadline: "([^\"]*)"$/ do |truth|
  unless truth.blank?
    @event.accept_proposal_comments_after_deadline = boolean_for(truth)
    @event.save!
  end
end

When /^I visit the proposal$/ do
  get proposal_path(@proposal)
end

Then /^the comments form is displayed: "([^\"]*)"$/ do |truth|
  method = boolean_for(truth) ? :should : :should_not
  page.send(method, have_selector("#comment-form"))
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
open_conference_ware-1.0.0.pre4 features/step_definitions/comment_new_steps.rb
open_conference_ware-1.0.0.pre3 features/step_definitions/comment_new_steps.rb
open_conference_ware-1.0.0.pre2 features/step_definitions/comment_new_steps.rb
open_conference_ware-1.0.0.pre1 features/step_definitions/comment_new_steps.rb