Sha256: f91bb1ec0692d28a72df342c5d743c135c9fa84e02172603f07936d29bc7bfc4

Contents?: true

Size: 1.32 KB

Versions: 34

Compression:

Stored size: 1.32 KB

Contents

When /^today is "([^\"]*)"$/ do |date|
  Time.stub!(:now).and_return(date.to_time)
end

When /^I publish the content$/ do
  visit noodall_admin_node_path(@_content)
  click_button('Publish')
end

When /^I hide the content$/ do
  visit noodall_admin_node_path(@_content)
  click_button('Hide')
end

Then /^the content should (not |)be visible on the website$/ do |is_not|
  if is_not.blank?
    visit node_path(@_content)
    page.should within('#content h1') { have_content(@_content.title) }
  else
    visit node_path(@_content)
    page.should have_content("The page you were looking for doesn't exist")
  end
end

Given /^I publish content between "([^\"]*)" and "([^\"]*)"$/ do |from, to|
  visit noodall_admin_node_path(@_content)
  select_datetime(from.to_time, :from => 'Publish at')
  select_datetime(to.to_time, :from => 'Publish until')
  click_button('Publish')
  page.should have_content('was successfully published')
end


Given /^published content exists with publish to date: "([^\"]*)"$/ do |time|
  time = time.to_time
  @_content = Factory(:page_a, :published_at => time.yesterday, :published_to => time)
end

When /^I am editing the content$/ do
  visit noodall_admin_node_path(@_content)
end

When /^I clear the publish to date$/ do
  5.times{ |i|   select("", :from => "node[published_to(#{i+1}i)]" ) }
  click_button 'Publish'
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
noodall-ui-0.5.15 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.14 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.13 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.12 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.11 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.4.11 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.4.10 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.10 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.9 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.4.9 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.8 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.4.8 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.4.7 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.7 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.6 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.5 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.4 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.3 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.2 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.5.1 features/step_definitions/pubish_content_steps.rb