AutoCommit Don Sep 3 16:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-09-03 16:03:01 +02:00
parent 984e5f4b56
commit f7ad93c398
6 changed files with 164 additions and 142 deletions

View File

@@ -0,0 +1,30 @@
module ViewMacros
def foreach_theme
RSpec.configuration.themes.each do |theme|
context " with theme #{theme}" do
before(:each) do
view.view_paths=[ "app/views/themes/#{theme}", "app/views"]
end
yield
end
end
end
def login_fet_user
before(:each) do
@request.env["devise.mapping"] = Devise.mappings[:user]
user = FactoryGirl.build(:user)
user = User.find_by_email(user.email) || user
user.save
user.add_role(:fetuser)
# user.confirm!
@user=user
@ability= Ability.new(@user)
# controller.stub(:current_ability) { @ability }
allow(view).to receive(:current_ability).and_return(@ability)
sign_in user
end
end
end