spec/support/profile.rb
# Create new profile for current user and select it
Create new profile for current user and select it
Create new profile for current user and select it
def with_profile(factory_name)
    let(:profile_cookie_name) { 'COOKIE_SELECTED_PROFILE_ID' }
    let(:main_profile) { FactoryGirl.create(factory_name, user_id: current_user.id) }
    before(:each) do
      create_cookie(profile_cookie_name, CGI.escape(ProfileSerializer.new(main_profile, root: false).to_json), path: '/')
    end
  end
def with_profile ( factory_name ) let ( :profile_cookie_name ) { 'COOKIE_SELECTED_PROFILE_ID' } let ( :main_profile ) { FactoryGirl . create ( factory_name , user_id : current_user . id ) } before ( :each ) do create_cookie ( profile_cookie_name , CGI . escape ( ProfileSerializer . new ( main_profile , root : false ) . to_json ) , path : '/' ) end end
Create new profile for current user and select it
Create new profile for current user and select it
factory_name
<not_specific>