Sha256: 5b132faaee683fc142bc657832a8517691ba58ebb79f445a62b0e4af442e9ede

Contents?: true

Size: 1.01 KB

Versions: 36

Compression:

Stored size: 1.01 KB

Contents

require File.join(File.dirname(__FILE__), "helpers", "spec_helper")

describe Videojuicer::User do
  
  before(:all) do
    @klass = Videojuicer::User
    configure_test_settings
  end
  
  describe "instantiation" do
    it_should_behave_like "a configurable"
  end
  
  describe "general interface:" do
    before(:all) do
      @singular_name = "user"
      @plural_name = "users"
    end
    
    it_should_behave_like "a RESTFUL resource model"
  end
  
  describe "authentication" do
    before(:all) do
      @attrs = Videojuicer::User.gen_attributes
      @auth_user = Videojuicer::User.new(@attrs)
      @auth_user.save.should be_true
    end
    
    
    it "returns User with good credentials" do
      u = Videojuicer::User.authenticate(@attrs[:login], @attrs[:password])
      u.should be_kind_of(Videojuicer::User)
      u.login.should == @attrs[:login]
    end
    
    it "returns nil with bad credentials" do
      Videojuicer::User.authenticate(@attrs[:login], "FOOOOBARRRRRR").should be_nil
    end
  end
  
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
vj-sdk-0.6.4 spec/user_spec.rb
vj-sdk-0.6.3 spec/user_spec.rb
vj-sdk-0.6.1 spec/user_spec.rb
vj-sdk-0.6.0 spec/user_spec.rb
vj-sdk-0.5.6 spec/user_spec.rb
vj-sdk-0.5.5 spec/user_spec.rb
vj-sdk-0.5.4 spec/user_spec.rb
vj-sdk-0.5.3 spec/user_spec.rb
vj-sdk-0.5.2 spec/user_spec.rb
vj-sdk-0.5.1 spec/user_spec.rb
vj-sdk-0.5.0 spec/user_spec.rb
vj-sdk-0.4.3 spec/user_spec.rb
vj-sdk-0.4.2 spec/user_spec.rb
vj-sdk-0.4.1 spec/user_spec.rb
vj-sdk-0.4.0 spec/user_spec.rb
vj-sdk-0.2.1 spec/user_spec.rb