Skip to content

Instantly share code, notes, and snippets.

@arjunatombud
Created May 24, 2012 21:07
Show Gist options
  • Save arjunatombud/2784244 to your computer and use it in GitHub Desktop.
Save arjunatombud/2784244 to your computer and use it in GitHub Desktop.
Code snippet for simple RSpec test
require 'spec_helper'
include Capybara::DSL
describe "user registration", :js => true, :driver => :selenium, :type => :request do
it "allows new users to register with an email address and password" do
puts Capybara.save_and_open_page_path.to_s
visit "http://10.10.10.96:8080"
click_on "Sign In"
page.should have_content("Have we already met?")
within("form#signin") do
fill_in "username", :with => "email1"
fill_in "password", :with => "password1"
click_on "signInButton"
end
fill_in "query", :with => "SendGrid"
find_field('query').native.send_key(:enter)
click_on "SendGrid Email Management"
click_link "step_1"
page.should have_content("Review of SendGrid")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment