2009-06-04 22:28:28 +02:00
|
|
|
Given /i am logged in as a user in the (.*) role/i do |role|
|
|
|
|
#@user = Factory.create(:user, :name => "Espen Antonsen",
|
2010-09-27 15:19:54 +02:00
|
|
|
# :email => "balder@balderapp.com",
|
|
|
|
# :password => "balder")
|
2009-06-04 22:28:28 +02:00
|
|
|
#@role = Factory.create(:role, :rolename => role)
|
|
|
|
#@user.roles << @role
|
|
|
|
visits "/login"
|
2010-09-27 15:19:54 +02:00
|
|
|
fills_in("email", :with => "balder@balderapp.com")
|
|
|
|
fills_in("password", :with => "balder")
|
2009-06-04 22:28:28 +02:00
|
|
|
clicks_button("Log in")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
Given /^I have albums titled (.+) in collection (.+)$/ do |titles,collection|
|
|
|
|
titles.split(', ').each do |title|
|
2009-06-16 01:22:51 +02:00
|
|
|
CollectionAlbum.create( :collection => Collection.find(collection), :album => Album.create!(:title => title) )
|
2009-06-04 22:28:28 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Given /^I have no albums$/ do
|
|
|
|
Album.destroy_all
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should have ([0-9]+) albums?$/ do |count|
|
|
|
|
Album.count.should == count.to_i
|
|
|
|
end
|