This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rails', '3.2.6' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'mysql2' | |
gem 'heroku' | |
gem 'newrelic_rpm' | |
gem 'exception_notification' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given /^a user visits the signin page$/ do | |
visit signin_path | |
end | |
When /^he submits invalid information$/ do | |
click_button "Sign in" | |
end | |
Then /^he should see an error message$/ do | |
page.should have_selector('div.alert.alert-error') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Signing in | |
Scenario: Unsuccessful signin | |
Given a user visits the signin page | |
When he submits invalid information | |
Then he should see an error message | |
Scenario: Successful signin | |
Given a user visits the signin page | |
And the user has an account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SessionsController < ApplicationController | |
def new | |
end | |
def create | |
user = User.find_by_email(params[:session][:email]) | |
if user && user.authenticate(params[:session][:password]) | |
sign_in user | |
redirect_to user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe ApplicationHelper do | |
describe "full_title" do | |
it "should include the page title" do | |
full_title("foo").should =~ /foo/ | |
end | |
it "should include the base title" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Schema Information | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# name :string(255) | |
# email :string(255) | |
# created_at :datetime not null | |
# updated_at :datetime not null | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "authentication" do | |
subject { page } | |
describe "signin page" do | |
before { visit signin_path } | |
describe "with invalid information" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "StaticPages" do | |
subject { page } | |
shared_examples_for "all static pages" do | |
it { should have_selector('h1', text: heading) } | |
it { should have_selector('title', text: full_title(page_title)) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "User pages" do | |
subject { page } | |
describe "profile page" do | |
let(:user) {FactoryGirl.create(:user) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :user do | |
name "Albert McKeever" | |
email "[email protected]" | |
password "$a36Le" | |
password_confirmation "$a36Le" | |
end | |
end |
OlderNewer