Commit 87d03b6
Changed files (3)
spec
spec/features/registrations_spec.rb
@@ -8,8 +8,8 @@ feature "Registrations", type: :feature do
end
describe "creating a new account" do
- it 'registers a new account' do
- subject.register_with(username: 'mo', email: 'mo@example.com', password: 'password')
+ it "registers a new account" do
+ subject.register_with(username: "mo", email: "mo@example.com", password: "password")
expect(current_path).to eql(dashboard_path)
end
@@ -17,7 +17,7 @@ feature "Registrations", type: :feature do
context "when the username is taken" do
let!(:user) { create(:user) }
- it 'displays an error' do
+ it "displays an error" do
subject.register_with(username: user.username)
expect(page).to have_content("Username has already been taken")
@@ -27,7 +27,7 @@ feature "Registrations", type: :feature do
context "when the email is taken" do
let!(:user) { create(:user) }
- it 'displays an error' do
+ it "displays an error" do
subject.register_with(email: user.email)
expect(page).to have_content("Email has already been taken")
spec/support/pages/new_registration_page.rb
@@ -1,4 +1,4 @@
-require_relative '../page_model.rb'
+require_relative "../page_model.rb"
class NewRegistrationPage < PageModel
def initialize
@@ -7,13 +7,13 @@ class NewRegistrationPage < PageModel
def register_with(username: Faker::Internet.user_name,
email: Faker::Internet.email,
- password: 'password',
- terms: true)
+ password: "password",
+ accept_terms: true)
within "#new_user" do
fill_in "Username", with: username
fill_in "Email", with: email
fill_in "Password", with: password
- check "I Agree"
+ check "I Agree" if accept_terms
click_button "Register"
end
end
spec/rails_helper.rb
@@ -3,7 +3,7 @@ ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
-require 'capybara/poltergeist'
+require "capybara/poltergeist"
# Add additional requires below this line. Rails is not loaded until this point!
# Requires supporting ruby files with custom matchers and macros, etc, in