Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rspec-instafail, test git headers
- Loading branch information
Raphael Sofaer
committed
Mar 6, 2011
1 parent
981c37d
commit e00a033
Showing
9 changed files
with
52 additions
and
21 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
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
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,40 @@ | ||
require 'spec_helper' | ||
|
||
describe ApplicationController do | ||
controller do | ||
def user_signed_in? | ||
nil | ||
end | ||
def current_user | ||
nil | ||
end | ||
def index | ||
render :nothing => true | ||
end | ||
end | ||
describe '#set_git_headers' do | ||
context 'with git info' do | ||
before do | ||
AppConfig[:git_update] = 'yesterday' | ||
AppConfig[:git_revision] = '02395' | ||
end | ||
it 'sets the git header if there is git info' do | ||
get :index | ||
response.headers['X-Git-Update'].should == 'yesterday' | ||
response.headers['X-Git-Revision'].should == '02395' | ||
end | ||
end | ||
#this context is commented out because the code to do it gets applied at environment load. | ||
#context 'without git info' do | ||
# before do | ||
# AppConfig.config_vars.delete(:git_update) | ||
# AppConfig.config_vars.delete(:git_revision) | ||
# end | ||
# it 'does not set the headers if there is no git info' do | ||
# get :index | ||
# response.headers.keys.should_not include('X-Git-Update') | ||
# response.headers.keys.should_not include('X-Git-Revision') | ||
# end | ||
#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
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