2010-08-01 10:37:49 +00:00
|
|
|
# Creates a Site record
|
|
|
|
#
|
|
|
|
# examples:
|
|
|
|
# - I have the site: "some site" set up
|
|
|
|
# - I have the site: "some site" set up with name: "Something", domain: "test2"
|
|
|
|
#
|
|
|
|
Given /^I have the site: "([^"]*)" set up(?: with #{capture_fields})?$/ do |site_factory, fields|
|
2011-09-17 14:23:43 +00:00
|
|
|
Thread.current[:site] = nil
|
2011-08-25 21:28:56 +00:00
|
|
|
@site = FactoryGirl.create(site_factory, parse_fields(fields))
|
2010-08-01 10:37:49 +00:00
|
|
|
@site.should_not be_nil
|
|
|
|
|
|
|
|
@admin = @site.memberships.first.account
|
|
|
|
@admin.should_not be_nil
|
|
|
|
end
|
|
|
|
|
2011-11-05 08:17:30 +00:00
|
|
|
Given /^I have a site set up$/ do
|
2011-11-27 08:29:09 +00:00
|
|
|
step %{I have the site: "test site" set up}
|
2011-11-05 08:10:26 +00:00
|
|
|
end
|
|
|
|
|
2011-06-27 15:27:07 +00:00
|
|
|
Given /^I have a designer and an author$/ do
|
2011-08-25 21:28:56 +00:00
|
|
|
FactoryGirl.create(:designer, :site => Site.first)
|
|
|
|
FactoryGirl.create(:author, :site => Site.first)
|
2011-07-05 09:56:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should be a administrator of the "([^"]*)" site$/ do |name|
|
|
|
|
site = Site.where(:name => name).first
|
|
|
|
m = site.memberships.detect { |m| m.account_id == @admin._id && m.admin? }
|
|
|
|
m.should_not be_nil
|
|
|
|
end
|
2011-07-05 20:34:15 +00:00
|
|
|
|
|
|
|
# sets the robot_txt for a site
|
|
|
|
|
|
|
|
Given /^a robot_txt set to "([^"]*)"$/ do |value|
|
|
|
|
@site.update_attributes(:robots_txt => value)
|
|
|
|
end
|