Sha256: d5a58b10beaed481a3f21c241bedb770d22503bc33ffec556db11c84ecefcf11

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

class Mg::RalliesControllerTest < ActionController::TestCase
  
  #index, new_rallies, show
  
  test "get index" do
    get :index, {}, logged_in
    assert_response :success
    assert_not_nil assigns(:rallies)
    
    get :index, { :convert_id => mg_converts(:two).id }, logged_in
    assert_response :success
    assert_not_nil assigns(:rallies)
    assert_equal mg_converts(:two).id, assigns(:rallies).first.convert_id
  end
  
  test "get new rallies" do
    get :new_rallies, {}, logged_in #should get everything
    assert_response :success
    assert_not_nil assigns(:rallies)
    assert_equal Mg::Rally.count, assigns(:rallies).count
    
    #should get nothing (we are up to date)
    get :new_rallies, { :recent_rally => Mg::Rally.last.id }, logged_in
    assert_response :success
    assert_not_nil assigns(:rallies)
    assert_equal 0, assigns(:rallies).count
  end
  
  test "get show" do
    get :show, { :id => mg_rallies(:one).id }, logged_in
    assert_response :success
    assert_not_nil assigns(:rally)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mountain-goat-1.0.6pre1 test/mg_rallies_controller_test.rb
mountain-goat-1.0.5 test/mg_rallies_controller_test.rb
mountain-goat-1.0.4 test/mg_rallies_controller_test.rb
mountain-goat-1.0.3 test/mg_rallies_controller_test.rb
mountain-goat-1.0.2 test/mg_rallies_controller_test.rb
mountain-goat-1.0.1 test/mg_rallies_controller_test.rb
mountain-goat-1.0.0 test/mg_rallies_controller_test.rb