Sha256: ca0e9ef4589ce39527e881d8178aaf6f5b9bab4c2d96e96ce3a0dc019535c760

Contents?: true

Size: 774 Bytes

Versions: 1

Compression:

Stored size: 774 Bytes

Contents

describe "User" do
  describe "attributes" do
    [:username, :password, :email].each do |attr|
      it "should have #{attr} attribute" do
        MotionParse::User.new.should.respond_to attr
        MotionParse::User.new.should.respond_to "#{attr}="
        MotionParse::User.attributes.should.include attr
      end
    end
  end
  
  describe "current" do
    it "should return user model with current user if set" do
      PFUser.currentUser = Object.new
      
      MotionParse::User.current.should.is_a MotionParse::User
      MotionParse::User.current.parse_object.should == PFUser.currentUser
    end
    
    it "should return nil if no current user is set" do
      PFUser.currentUser = nil
      
      MotionParse::User.current.should.be.nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
motion-parse-0.0.1 spec/user_spec.rb