mercredi 25 mars 2015

Waint until visit finishes

I have a problem with my test, basically I have to visit an specific page, but this action take more than 10 seconds to execute, and not matter what I do, I don't know to wait until, here's my test.



feature 'Basekit settings' do
before(:each) do
clean_and_seed_db
create_roles
end

describe 'Setup Basekit credentials', js:true do
let(:user) { FactoryGirl.build(:user) }
let(:registered_user) { FactoryGirl.create(:user, :with_sub_referrals, verify: true) }
let(:product) { Product.where(:alias => 'basekit').first }
@current_credentials = nil
before {
begin
login_with(registered_user.email, registered_user.password)
add_product(product)
visit_basekit_setup
@current_credentials = registered_user.accounts.first.product_credentials.first
rescue Exception
save_and_open_page
end
}
it { expect(@current_credentials).to_not be_nil }
it { expect(response.status).to be 302 }
it { expect(expect(response.header['location']).to match(current_credentials.value[:domain])) }
end
end

Aucun commentaire:

Enregistrer un commentaire