Testing Facebook Share button with Poltergeist
I want to test that the facebook popup contains the correct things that I
passed to it. This is my test thus far:
context "Javascript", :js => true do
it "shares the personality page" do
first(".facebook").click
fb_popup = page.driver.window_handles.last
page.within_window fb_popup do
page.find('#preview_container').should have_content("my_image.png")
end
end
end
But I realized that it won't work because if a user isn't signed in, they
will be prompted to. So my question is how can I sign a user into facebook
first, and then go through this?
I could sign myself in by filling out the form, but since I'm working with
other programmers on the same repository I don't want my info to be saved
there.
The more realistic option is to create a test user with facebook, but I'm
unsure of how to do this through my Poltergeist tests
No comments:
Post a Comment