spec/findable/query_spec.rb in findable-0.1.5 vs spec/findable/query_spec.rb in findable-0.2.0

- old
+ new

@@ -6,20 +6,20 @@ let(:auto_increment_key) { Findable::Query::Namespace::AUTO_INCREMENT_KEY } describe "#data" do it { expect(read_model.query.all).to be_kind_of(Array) } - it { expect(read_model.query.all.size).to eq(1) } + it { expect(read_model.query.all.size).to eq(CategoryData.size) } end describe "#ids" do it { expect(read_model.query.ids).to be_kind_of(Array) } - it { expect(read_model.query.ids).to eq([1]) } + it { expect(read_model.query.ids).to eq(CategoryData.map {|h| h[:id]}) } end describe "#count" do - it { expect(read_model.query.count).to eq(1) } + it { expect(read_model.query.count).to eq(CategoryData.size) } end describe "#find_by_ids" do let(:data) { read_model.query.find_by_ids(1) } @@ -28,10 +28,10 @@ it { expect(data.first.id).to eq(1) } end describe "#exists?" do it { expect(read_model.exists?(1)).to be_truthy } - it { expect(read_model.exists?(2)).to be_falsey } + it { expect(read_model.exists?(100)).to be_falsey } end describe "#insert" do it { expect(model.create(name: name)).to be_kind_of(model) } it { expect(model.create(name: name).id).not_to be_nil }