Sha256: f48f6ed783d22ed750d91d6ef4b5d03f5615ab5cf220657679c84292963607fb

Contents?: true

Size: 1.6 KB

Versions: 56

Compression:

Stored size: 1.6 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../rails_test_helper')

class Facebooker::Rails::FacebookUrlRewritingTest < Test::Unit::TestCase

  def setup
    @request = ActionController::TestRequest.new
    @params = {}
    @rewriter = ActionController::UrlRewriter.new(@request, @params)
  end

  def test_one_or_true_on_string_1
    assert @rewriter.one_or_true( "1" )
  end

  def test_one_or_true_on_string_0
    assert !@rewriter.one_or_true( "0" )
  end

  def test_one_or_true_on_integer_1
    assert @rewriter.one_or_true( 1 )
  end

  def test_one_or_true_on_float_1
    assert @rewriter.one_or_true( 1.0 )
  end

  def test_one_or_true_on_true
    assert @rewriter.one_or_true( true )
  end

  def test_one_or_true_on_false
    assert !@rewriter.one_or_true( false )
  end

  def test_one_or_true_on_nil
    assert !@rewriter.one_or_true( nil )
  end


  def test_zero_or_false_on_blank
    assert @rewriter.zero_or_false( "" )
  end

  def test_zero_or_false_on_integer_0
    assert @rewriter.zero_or_false( 0 )
  end

  def test_zero_or_false_on_float_0
    assert @rewriter.zero_or_false( 0.0 )
  end

  def test_zero_or_false_on_string_0
    assert @rewriter.zero_or_false( "0" )
  end

  def test_zero_or_false_on_false
    assert @rewriter.zero_or_false( false )
  end

  def test_zero_or_false_on_nil
    assert @rewriter.zero_or_false( nil )
  end

  def test_zero_or_false_on_string_1
    assert !@rewriter.zero_or_false( "1" )
  end

  def test_zero_or_false_on_numeric_1
    assert !@rewriter.zero_or_false( 1 )
  end

  def test_zero_or_false_on_true
    assert !@rewriter.zero_or_false( true )
  end

end

Version data entries

56 entries across 56 versions & 17 rubygems

Version Path
micahwedemeyer-facebooker-1.0.50 test/facebooker/rails/facebook_url_rewriting_test.rb
micahwedemeyer-facebooker-1.0.51 test/facebooker/rails/facebook_url_rewriting_test.rb
mmangino-facebooker-1.0.46 test/facebooker/rails/facebook_url_rewriting_test.rb
mmangino-facebooker-1.0.47 test/facebooker/rails/facebook_url_rewriting_test.rb
mmangino-facebooker-1.0.48 test/facebooker/rails/facebook_url_rewriting_test.rb
mmangino-facebooker-1.0.49 test/facebooker/rails/facebook_url_rewriting_test.rb
mmangino-facebooker-1.0.50 test/facebooker/rails/facebook_url_rewriting_test.rb
pomartel-facebooker-1.0.45 test/facebooker/rails/facebook_url_rewriting_test.rb
pomartel-facebooker-1.0.47 test/facebooker/rails/facebook_url_rewriting_test.rb
simianarmy-facebooker-1.0.50 test/facebooker/rails/facebook_url_rewriting_test.rb
simianarmy-facebooker-1.0.51 test/facebooker/rails/facebook_url_rewriting_test.rb
taweili-facebooker-1.0.47 test/facebooker/rails/facebook_url_rewriting_test.rb
taweili-facebooker-1.0.50 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-1.0.75 test/facebooker/rails/facebook_url_rewriting_test.rb
sentientmonkey-facebooker-1.0.74 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-micah-1.0.74 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-1.0.74 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-1.0.73 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-1.0.72 test/facebooker/rails/facebook_url_rewriting_test.rb
facebooker-1.0.71 test/facebooker/rails/facebook_url_rewriting_test.rb