1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/features/step_definitions/middleman_steps.rb

30 lines
869 B
Ruby
Raw Normal View History

2009-11-22 18:37:11 -05:00
Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
if state == "enabled"
Middleman::Server.activate(feature.to_sym)
end
@browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server.new))
2009-11-22 18:37:11 -05:00
end
Given /^the Server is running$/ do
@browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server.new))
2009-11-30 14:32:02 -05:00
end
2009-11-22 18:37:11 -05:00
When /^I go to "([^\"]*)"$/ do |url|
@browser.get(url)
end
Then /^I should see "([^\"]*)"$/ do |expected|
@browser.last_response.body.should include(expected)
end
2011-04-25 16:45:54 -04:00
Then /^I should see '([^\']*)'$/ do |expected|
@browser.last_response.body.should include(expected)
end
2009-11-22 18:37:11 -05:00
Then /^I should not see "([^\"]*)"$/ do |expected|
@browser.last_response.body.should_not include(expected)
end
Then /^I should see "([^\"]*)" lines$/ do |lines|
@browser.last_response.body.chomp.split($/).length.should == lines.to_i
end