Sha256: 5e1beb7c9e8a9fd8b3ad543ffc65476ac44429335c0926905ca4826bb482bd19

Contents?: true

Size: 803 Bytes

Versions: 9

Compression:

Stored size: 803 Bytes

Contents

require 'test_helper'

class StoreTest < ActiveSupport::TestCase
  setup do
    @user = TestUser.create(:name => 'davis')
  end
  
  def default_args
    { :stream_type => 'streamit.example', 
      :actor       => @user, 
      :receiver    => @user, 
      :subject     => @user,
      :started_at  => Time.now }
  end

  def store!(args=default_args)
    stream = Stream.new(args)
  end
  
  should "set the type" do
    assert_equal "streamit.example", store!.stream_type
  end

  should "set started at" do
    assert_kind_of Time, store!.started_at
  end
  
  should "translate type to meaningful words" do
    I18n.backend.store_translations :en,
      :streamit => { :example => "just an example" }
  
    assert_equal "just an example", store!.stream_type_in_words
    I18n.reload!
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
streamit-0.0.8 test/store_test.rb
streamit-0.0.7 test/store_test.rb
streamit-0.0.6.2 test/store_test.rb
streamit-0.0.6.1 test/store_test.rb
streamit-0.0.6 test/store_test.rb
streamit-0.0.5 test/store_test.rb
streamit-0.0.4 test/store_test.rb
streamit-0.0.3 test/store_test.rb
streamit-0.0.1 test/store_test.rb