Sha256: 84e249e257ac08552ab9d9f964fab4c0070bdcfde2f76562d4e0fa7a93bdfb98

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

require File.expand_path('../../test_helper', __FILE__)

module Screenbeacon
  class TestTest < ::Test::Unit::TestCase
    should "tests should be listable" do
      @mock.expects(:get).once.returns(test_response(test_test_array))
      c = Screenbeacon::Test.all
      assert c.kind_of? Array
      assert c[0].kind_of? Screenbeacon::ScreenbeaconObject
    end

    should "test should be deletable" do
      @mock.expects(:delete).once.returns(test_response(test_test({:deleted => true})))
      c = Screenbeacon::Test.new("test_test")
      c.delete
      assert c.deleted
    end

    # should "tests should be updateable" do
    #   @mock.expects(:get).once.returns(test_response(test_test({:name => "fubu"})))
    #   @mock.expects(:post).once.returns(test_response(test_test({:name => "barbu"})))
    #   c = Screenbeacon::Test.new("test_test").refresh
    #   assert_equal "fubu", c.name
    #   c.name = "barbu"
    #   c.save
    #   assert_equal "barbu", c.name
    # end

    should "create should return a new test" do
      @mock.expects(:post).once.returns(test_response(test_test({:name => "Screenbeacon"})))
      c = Screenbeacon::Test.create
      assert_equal "Screenbeacon", c.name
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
screenbeacon-1.0.2 test/screenbeacon/test_test.rb
screenbeacon-1.0.1 test/screenbeacon/test_test.rb
screenbeacon-1.0.0 test/screenbeacon/test_test.rb
screenbeacon-0.1.0 test/screenbeacon/test_test.rb