Created
March 14, 2013 20:58
-
-
Save abacha/5165213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| require 'spec_helper' | |
| feature "accounts" do | |
| given(:person) { create(:person).decorate } | |
| background { login_as(person.user) } | |
| scenario "creating individual account" do | |
| visit "/accounts/new" | |
| within(".clients_0") do | |
| find_field("Nome Completo").value.should == person.name | |
| find_field("CPF").value.should == person.cpf | |
| find_field("Email").value.should == person.email | |
| find_field("Telefone Celular").value.should == person.phone_mobile | |
| end | |
| choose "Conta Individual" | |
| click_on "Próximo ►" | |
| person.accounts.should have(1).item | |
| page.should have_content("Informações Pessoais") | |
| page.should have_content(person.name.upcase) | |
| end | |
| scenario "creating joined account with a new user" do | |
| visit "/accounts/new" | |
| within(".clients_0") do | |
| find_field("Nome Completo").value.should == person.name | |
| find_field("CPF").value.should == person.cpf | |
| find_field("Email").value.should == person.email | |
| find_field("Telefone Celular").value.should == person.phone_mobile | |
| select "Titular" | |
| end | |
| choose "Conta Conjunta" | |
| within(".clients_1") do | |
| fill_in "Nome Completo", with: "John Doe" | |
| fill_in "CPF", with: "090.128.707-55" | |
| fill_in "Email", with: "[email protected]" | |
| fill_in "Telefone Celular", with: "(21) 33566312" | |
| end | |
| click_on "Próximo ►" | |
| person.accounts.should have(1).item | |
| page.should have_content("Informações Pessoais") | |
| page.should have_content(person.name.upcase) | |
| page.should have_content(Person.find_by_cpf("090.128.707-55").name.upcase) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment