Sha256: e3d22bc3436473891631955b17cf4310bd74081eff8d3fbbb8f4587b4341f0c8

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

require "test_helper"

class UserStampingTest < ActiveSupport::TestCase

  def setup

  end

  def teardown

  end

  test "if no current user, then timestamp should be nil" do
    Cms::User.expects(:current).returns(nil).at_least_once
    block = Cms::HtmlBlock.create!(:name=>"A")

    assert_nil block.created_by
    assert_nil block.updated_by
  end

  test "if no current user is false, then timestamp should be nil" do
    Cms::User.expects(:current).returns(false).twice
    block = Cms::HtmlBlock.create!(:name=>"A")
    assert_nil block.created_by
    assert_nil block.updated_by
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
browsercms-3.4.2 test/unit/behaviors/userstamping_test.rb
browsercms-3.4.2.rc1 test/unit/behaviors/userstamping_test.rb
browsercms-3.4.1 test/unit/behaviors/userstamping_test.rb
browsercms-3.4.0 test/unit/behaviors/userstamping_test.rb
browsercms-3.4.0.rc2 test/unit/behaviors/userstamping_test.rb
browsercms-3.4.0.rc1 test/unit/behaviors/userstamping_test.rb