Skip to content

Instantly share code, notes, and snippets.

@machty
Created October 9, 2014 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machty/cbd419b14ad7497e0ace to your computer and use it in GitHub Desktop.
Save machty/cbd419b14ad7497e0ace to your computer and use it in GitHub Desktop.
test("customers can use a forgot password link", function() {
ajax('/setup_test_env/signup/preexisting-users').then(function() {
visit(...);
fillIn(...);
click(...);
andThen(function() {
equal(find('.errors p').text(), "E-mail taken");
});
});
});
require 'spec_helper'
describe "states" do
before do
# create any global state shared with any states defined below
end
context "signup" do
context "preexisting-users" do
before do
FactoryGirl.create(:customer)
end
it "sets up expected environment" do
# This is only used on the rails side to validate that
# the expected database/server state has been established
# so that when the JS suite requests this state to be set up,
# everything will be set up as expected.
# But actually providing an `it` rails test for
# each nested describe/context/context etc environment/state
# is optional
expect(Customer.count).to eq(1)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment