Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created August 9, 2015 21:33
Show Gist options
  • Save angelsystem/b93422ba00491a5f84d0 to your computer and use it in GitHub Desktop.
Save angelsystem/b93422ba00491a5f84d0 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe 'creating_seller_profile', type: :feature do
context 'create a new seller profile', js: true do
let!(:seller) { create(:seller) }
before do
log_in_as_seller(seller)
end
it 'should create a seller profile' do
visit new_seller_seller_profile_path(seller)
fill_in 'seller_profile_name', with: 'el carbonero'
fill_in 'seller_profile_description', with: FFaker::BaconIpsum.paragraph
image_path = "#{Rails.root}/public/images/medium/missing.jpg"
attach_file 'seller_profile_picture1', image_path
select '3', from: 'seller_profile_coupon_use'
fill_in 'seller_profile_about_us', with: FFaker::BaconIpsum.paragraph(2)
fill_in 'seller_profile_phone', with: '987612559'
fill_in 'seller_profile_email', with: 'minegocio@example.com'
fill_in 'seller_profile_address', with: 'Av. saint saenz 549, san borja, Lima'
click_button 'Crear Perfil de vendedor'
expect(page).to have_content('El perfil se guardo correctamente.')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment