Sha256: 5f0f4472ca195f979de71ef20420732d5277e8a3bd45054eef732fcfa470786d

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

require "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

1 entries across 1 versions & 1 rubygems

Version Path
vj-sdk-0.8.2 spec/user_spec.rb