2009-11-22 15:37:11 -08:00
|
|
|
Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
|
2010-09-06 18:48:25 -07:00
|
|
|
if state == "enabled"
|
|
|
|
Middleman::Server.activate(feature.to_sym)
|
|
|
|
end
|
2011-05-29 17:26:58 +02:00
|
|
|
Middleman::Server.environment = @current_env || :development
|
2010-09-05 19:28:38 -07:00
|
|
|
@browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server.new))
|
2009-11-22 15:37:11 -08:00
|
|
|
end
|
|
|
|
|
2011-05-29 17:26:58 +02:00
|
|
|
Given /^current environment is "([^\"]*)"$/ do |env|
|
|
|
|
@current_env = env.to_sym
|
|
|
|
end
|
|
|
|
|
2010-09-06 10:59:51 -07:00
|
|
|
Given /^the Server is running$/ do
|
|
|
|
@browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server.new))
|
2009-11-30 11:32:02 -08:00
|
|
|
end
|
|
|
|
|
2009-11-22 15:37:11 -08: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 13:45:54 -07:00
|
|
|
|
2010-09-06 10:59:51 -07:00
|
|
|
Then /^I should see '([^\']*)'$/ do |expected|
|
|
|
|
@browser.last_response.body.should include(expected)
|
|
|
|
end
|
2009-11-22 15:37:11 -08: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
|