Skip to content

Instantly share code, notes, and snippets.

@bobbywilson0
Created January 5, 2014 16:36
Show Gist options
  • Save bobbywilson0/8270410 to your computer and use it in GitHub Desktop.
Save bobbywilson0/8270410 to your computer and use it in GitHub Desktop.
def bootstrap
reseller = FactoryGirl.create(:reseller)
FactoryGirl.create(:shipping_price_list, reseller_id: reseller.id)
@template = create_website_template
create_theme_website(@template)
@user = FactoryGirl.create(:user, reseller_id: reseller.id, auth_token: SecureRandom.urlsafe_base64)
@website = FactoryGirl.create(:website, :active_template_id => @template.id, :user_id => @user.id)
end
def user_logs_in
visit '/sessions/new'
fill_in "first_form_field", :with => 'username2'
fill_in "password", :with => 'larrys'
click_button "Login"
end
before(:each) do
bootstrap
user_logs_in
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment