Sha256: 7991790bd33c25952ac899ab1337efb1a22449e13e0525465f2d5217033e6abe

Contents?: true

Size: 1.12 KB

Versions: 25

Compression:

Stored size: 1.12 KB

Contents

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

class KeyTest < Test::Unit::TestCase
  include Octopi
  
  def setup
    fake_everything
    @user = User.find("fcoury")
    auth do
      @key = Api.me.keys.first
    end
  end
  
  context Key do
    
    should "be able to add a key" do
      auth do
        Key.add(:title => "other-computer", :key => "AAAAB3NzaC1yc2EAAAABIwAAAQEA0dyfPrSHHSVD0u3JQlJfLyUrEVeNDW+9imbMHwiuT/IStf8SOroRjWT+/S5cL9m6qmKQBIU4v3LUnMKLTHfiWlqICnTDVRHuSayrHGp193I9kTSGBdM7wFZ2E8hDv5OqXHvAKGmOJvl5RqK0d42mhoK/x3bLRMQXHxwSDmYIFLy9rXLMvbVbdFJbbcqXP6QjnP4fAeebvTnUs6bVzInL9nh8Tqb3qjB5qji2i0MiCz3IouuZonOlef/VEac3Zpm6NcI5rVthPsMY55G8BMu4rVEStbIUlAJPoSBzqOgEKEXQbmWLh3CZnOoqQlLwIIvrKlwnXx26M1b+oOFm8s712Q==")
      end
    end
    
    should "be able to remove a key" do
      auth do
        assert_equal 2, Api.me.keys.size
        @key.remove
        # Just trust me on this one
        FakeWeb.register_uri(:get, "https://#{yaml_api}/user/keys" + auth_query, :response => stub_file(File.join("users", "key-removed")))
        assert_equal 1, Api.me.keys.size
      end
    end
      
      
    
  end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
octopi-0.4.5 test/key_test.rb
octopi-0.4.4 test/key_test.rb
octopi-0.4.2 test/key_test.rb
octopi-0.4.1 test/key_test.rb
octopi-0.4.0 test/key_test.rb
octopi-0.3.0 test/key_test.rb
dcuddeback-octopi-0.2.12 test/key_test.rb
dcuddeback-octopi-0.2.11 test/key_test.rb
dcuddeback-octopi-0.2.9 test/key_test.rb
dcuddeback-octopi-0.2.8 test/key_test.rb
devver-octopi-0.2.14 test/key_test.rb
tpitale-octopi-0.3.0 test/key_test.rb
devver-octopi-0.2.13 test/key_test.rb
devver-octopi-0.2.12 test/key_test.rb
octopi-0.2.8 test/key_test.rb
devver-octopi-0.2.11 test/key_test.rb
devver-octopi-0.2.10 test/key_test.rb
devver-octopi-0.2.9 test/key_test.rb
devver-octopi-0.2.8 test/key_test.rb
octopi-0.2.7 test/key_test.rb