Sha256: d3cbd007d36c972faeabeeacec0d12e7fc80f8aaca2bf00901ec38f4e9510879
Contents?: true
Size: 1.04 KB
Versions: 22
Compression:
Stored size: 1.04 KB
Contents
Given /^some nodes exist$/ do Time.stub!(:now).and_return(Time.parse("01/01/2010 13:37")) f = Factory.build(:node) f.title = "A Header" f.save Time.stub!(:now).and_return(Time.parse("01/01/2010 14:37")) f = Factory.build(:node) f.title = "B Header" f.save Time.stub!(:now).and_return(Time.parse("01/01/2010 15:37")) f = Factory.build(:page_a) f.title = "C Header" f.save end Then /^the nodes should be ordered by "Name"$/ do Then %{I should see in this order: A Header, B Header, C Header} end Then /^the nodes should be ordered by "Type"$/ do Then %{I should see in this order: Page A, Noodall/Node, Noodall/Node} end Then /^the nodes should be ordered by "Updated"$/ do Then %{I should see in this order: 15:37:00, 14:37:00, 13:37:00 } end Then /^(?:|I )should see in this order(?: within "([^\"]*)")?: (.*)$/ do |selector, text| order = Regexp.new(text.gsub(', ', '.*'), Regexp::MULTILINE) with_scope(selector) do raise "Did not find keywords (#{text}) in the requested order!" unless page.body =~ order end end
Version data entries
22 entries across 22 versions & 1 rubygems