Sha256: a35bb4438848e705949ea087c3b06a9fe2993cc3226f568e39f3fb372dfa8dab

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe 'Account user', type: :feature do
  context 'show brazilian fields' do

    # login into user page
    before do
      @user = Spree.user_class.create(email: 'user@test.com',
                                      password: 'password',
                                      password_confirmation: 'password',
                                      name: 'users name',
                                      cpf: CPF.generate(true),
                                      rg: '123',
                                      birth_date: Date.today,
                                      gender: 'f')
      @role = Spree::Role.create(name: 'user')
      @role.users << @user
      sign_in_as! @user
    end

    it 'should show the brazilian fields in users#show', js: true do
      visit spree.account_path

      expect(page).to have_text @user.name
      expect(page).to have_text @user.cpf
      expect(page).to have_text @user.rg
      expect(page).to have_text @user.birth_date.strftime(I18n.t('date.formats.default'))
      expect(page).to have_text 'Female'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_zaez_brazilian_fields-3.1.0 spec/features/account_spec.rb
spree_zaez_brazilian_fields-3.0.1 spec/features/account_spec.rb