Sha256: 40db296d4622d8731945779240e572d81b4f42ed2b3d56cf1cf5519a50664d08

Contents?: true

Size: 550 Bytes

Versions: 16

Compression:

Stored size: 550 Bytes

Contents

require "test_helper"

class Admin::CommentsControllerTest < ActionController::TestCase

  setup do
    @typus_user = Factory(:typus_user)
    @request.session[:typus_user_id] = @typus_user.id
    @comment = Factory(:comment)
    @request.env['HTTP_REFERER'] = "/admin/comments"
  end

  should "toggle" do
    get :toggle, { :id => @comment.id, :field => "spam" }

    assert_response :redirect
    assert_redirected_to @request.env["HTTP_REFERER"]
    assert_equal "Comment spam changed.", flash[:notice]
    assert @comment.reload.spam
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
typus-3.0.2 test/functional/admin/comments_controller_test.rb
typus-3.0.1 test/functional/admin/comments_controller_test.rb
typus-3.0.0 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre13 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre12 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre11 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre10 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre9 test/functional/admin/comments_controller_test.rb
typus-1.0.0.pre8 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre7 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre6 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre5 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre4 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre3 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre2 test/functional/admin/resources_controller_comments_toggle_test.rb
typus-1.0.0.pre test/functional/admin/resources_controller_comments_toggle_test.rb