Hi. Now i writing tests via Rspec and appeared a question.
Question is how can i create few connections, at least two connections for testing online changes at page ? It’s only online chat.
At this time a have only
let(:user) { FactoryGirl.create(:user) }
before do
visit signin_path
fill_in "Name", with: user.name
fill_in "Password", with: user.password
click_button "Sign in"
end
But i looking for something like this:
let(:first_user) { FactoryGirl.create(:user) }
let(:second_user) { FactoryGirl.create(:user) }
at connection: :first_connection do
before do
visit signin_path
fill_in "Name", with: first_user.name
fill_in "Password", with: first_user.password
click_button "Sign in"
end
end
at connection: :second_connection do
before do
visit signin_path
fill_in "Name", with: second_user.name
fill_in "Password", with: second_user.password
click_button "Sign in"
end
end
manipulate with connections
Thanks.