Sha256: 28c53118e2d7ad649b977beb5e9329d6e2cb803ba61c4bcec7405f7321b17387

Contents?: true

Size: 1.33 KB

Versions: 44

Compression:

Stored size: 1.33 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 save content as draft$/ do
  visit noodall_admin_node_path(@_content)
  click_button('Draft')
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 updated')
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

44 entries across 44 versions & 1 rubygems

Version Path
noodall-ui-0.3.20 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.19 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.17 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.16 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.15 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.14 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.13 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.12 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.11 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.8 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.7 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.6 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.5 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.4 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.3 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.2 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.1 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.3.0 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.2.3 features/step_definitions/pubish_content_steps.rb
noodall-ui-0.2.2 features/step_definitions/pubish_content_steps.rb