Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Blaichinger
committed
Jan 25, 2011
1 parent
58fc32e
commit 736dd55
Showing
20 changed files
with
1,174 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ group :test do | |
gem 'webrat', '0.7.1' | ||
gem 'factory_girl_rails', '1.0' | ||
gem 'faker' | ||
|
||
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
module UsersHelper | ||
|
||
def gravatar_for(user, options = { :size => 150}) | ||
gravatar_image_tag(user.email.downcase, :alt => user.name, | ||
:class => 'gravatar', | ||
:gravatar => options) | ||
def gravatar_for(user, options = { :size => 150, :default => 'identicon'}) | ||
gravatar_image_tag(user.email.downcase, :alt => user.name, :class => 'gravatar', | ||
:gravatar => options) | ||
end | ||
|
||
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'spec_helper' | ||
|
||
describe PagesController do | ||
render_views | ||
|
||
before(:each) do | ||
@base_title = "Last Plant" | ||
end | ||
|
||
describe "GET 'about'" do | ||
it "should be successful" do | ||
get 'about' | ||
response.should be_success | ||
end | ||
|
||
it "should have the right title" do | ||
get 'about' | ||
response.should have_selector("title", | ||
:content => @base_title + " | About") | ||
end | ||
end | ||
|
||
describe "GET 'imprint'" do | ||
it "should be successful" do | ||
get 'imprint' | ||
response.should be_success | ||
end | ||
|
||
it "should have the right title" do | ||
get 'imprint' | ||
response.should have_selector("title", | ||
:content => @base_title + " | Imprint") | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
require 'spec_helper' | ||
|
||
describe SessionsController do | ||
render_views | ||
|
||
describe "GET 'new'" do | ||
|
||
it "should be successful" do | ||
get :new | ||
response.should be_success | ||
end | ||
|
||
it "should have the right title" do | ||
get :new | ||
response.should have_selector("title", :content => "Sign in") | ||
end | ||
end | ||
|
||
|
||
describe "POST 'create'" do | ||
|
||
describe "invalid signin" do | ||
|
||
before(:each) do | ||
@attr = { :email => "email@example.com", :password => "invalid" } | ||
end | ||
|
||
it "should re-render the new page" do | ||
post :create, :session => @attr | ||
response.should redirect_to(root_path) | ||
end | ||
|
||
it "should have a flash.now message" do | ||
post :create, :session => @attr | ||
flash.now[:error].should =~ /invalid/i | ||
end | ||
end | ||
|
||
|
||
describe "with valid email and password" do | ||
|
||
before(:each) do | ||
@user = Factory(:user) | ||
@attr = { :email => @user.email, :password => @user.password } | ||
end | ||
|
||
it "should sign the user in" do | ||
post :create, :session => @attr | ||
controller.current_user.should == @user | ||
controller.should be_signed_in | ||
end | ||
|
||
it "should redirect to the user show page" do | ||
post :create, :session => @attr | ||
response.should redirect_to(user_path(@user)) | ||
end | ||
end | ||
end | ||
|
||
|
||
describe "DELETE 'destroy'" do | ||
|
||
before(:each) do | ||
@user = Factory(:user) | ||
@attr = { :email => @user.email, :password => @user.password } | ||
end | ||
|
||
it "should sign the user in" do | ||
post :create, :session => @attr | ||
controller.current_user.should == @user | ||
controller.should be_signed_in | ||
end | ||
|
||
it "should sign a user out" do | ||
delete :destroy | ||
controller.should_not be_signed_in | ||
response.should redirect_to(root_path) | ||
end | ||
end | ||
end |
Oops, something went wrong.