Skip to content

Commit

Permalink
Add functional tests for projects controller patch
Browse files Browse the repository at this point in the history
  • Loading branch information
biow0lf committed Dec 24, 2011
1 parent 5700991 commit 0c29770
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/functional/projects_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require File.dirname(__FILE__) + '/../test_helper'
require_dependency 'projects_controller'

class ProjectsControllerTest < ActionController::TestCase
def setup
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end

def test_no_redirect_to_landing_page
@project = Project.generate!(:identifier => 'demo')
get :show, :id => @project.identifier
assert_response :success
assert_template 'show'
end

def test_redirect_to_landing_page
@project = Project.generate!(:identifier => 'demo',
:landing_page => "http://#{@request.host}/projects/demo/news")
get :show, :id => @project.identifier
assert_redirected_to "http://#{@request.host}/projects/#{@project.identifier}/news"
end
end

0 comments on commit 0c29770

Please sign in to comment.