Sha256: 5d8c911a7373bf1e323afc3090511000eb6cb221e7cf3a7fde248c5ca79b464f

Contents?: true

Size: 750 Bytes

Versions: 4

Compression:

Stored size: 750 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Dynamoid::Criteria" do
  
  before do
    @user1 = User.create(:name => 'Josh', :email => 'josh@joshsymonds.com')
    @user2 = User.create(:name => 'Justin', :email => 'justin@joshsymonds.com')
  end
  
  it 'finds first using where' do
    User.where(:name => 'Josh').first.should == @user1
  end
  
  it 'finds all using where' do
    User.where(:name => 'Josh').all.should == [@user1]
  end
  
  it 'returns all records' do
    User.all.should == [@user1, @user2]
  end
  
  it 'returns empty attributes for where' do
    Magazine.where(:name => 'Josh').all.should == []
  end
  
  it 'returns empty attributes for all' do
    Magazine.all.should == []
  end
  

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dynamoid-0.1.1 spec/dynamoid/criteria_spec.rb
dynamoid-0.1.0 spec/dynamoid/criteria_spec.rb
dynamoid-0.0.7 spec/dynamoid/criteria_spec.rb
dynamoid-0.0.6 spec/dynamoid/criteria_spec.rb