pull/100/head
Christian Rijke 12 years ago
parent a6a46306b1
commit d485a85da0
  1. 23
      test/functional/issues_controller_test.rb
  2. 19
      test/functional/journals_controller_test.rb
  3. 4
      test/integration/routing_test.rb

@ -1356,11 +1356,28 @@ class IssuesControllerTest < ActionController::TestCase
end
end
def test_reply_to_note
def test_quote_issue
@request.session[:user_id] = 2
get :edit, :id => 1, :journal_id => 1
get :quoted, :id => 6
assert_response :success
assert_select_rjs :show, "update"
assert_template 'edit'
assert_not_nil assigns(:issue)
assert_equal Issue.find(6), assigns(:issue)
end
def test_quote_issue_without_permission
@request.session[:user_id] = 7
get :quoted, :id => 6
assert_response 403
end
def test_quote_note
@request.session[:user_id] = 2
get :quoted, :id => 6, :journal_id => 4
assert_response :success
assert_template 'edit'
assert_not_nil assigns(:issue)
assert_equal Issue.find(6), assigns(:issue)
assert_equal Journal.find(4), assigns(:journal)
end
end

@ -61,24 +61,5 @@ class JournalsControllerTest < ActionController::TestCase
assert_equal 'application/atom+xml', @response.content_type
end
def test_reply_to_issue
@request.session[:user_id] = 2
get :new, :id => 6
assert_response :success
assert_select_rjs :show, "update"
end
def test_reply_to_issue_without_permission
@request.session[:user_id] = 7
get :new, :id => 6
assert_response 403
end
def test_reply_to_note
@request.session[:user_id] = 2
get :new, :id => 6, :journal_id => 4
assert_response :success
assert_select_rjs :show, "update"
end
end

@ -217,8 +217,8 @@ class RoutingTest < ActionDispatch::IntegrationTest
should route(:post, "/issues/move").to( :controller => 'issues/moves',
:action => 'create')
should route(:post, "/issues/1/quoted").to( :controller => 'journals',
:action => 'new',
should route(:get, "/issues/1/quoted").to( :controller => 'issues',
:action => 'quoted',
:id => '1')
should route(:get, "/issues/calendar").to( :controller => 'issues/calendars',

Loading…
Cancel
Save