spec/object_identity_spec.rb in terrestrial-0.1.1 vs spec/object_identity_spec.rb in terrestrial-0.3.0

- old
+ new

@@ -1,20 +1,18 @@ require "spec_helper" -require "support/mapper_setup" -require "support/sequel_persistence_setup" +require "support/object_store_setup" require "support/seed_data_setup" require "terrestrial" RSpec.describe "Object identity" do - include_context "mapper setup" - include_context "sequel persistence setup" + include_context "object store setup" include_context "seed data setup" - subject(:mapper) { mappers.fetch(:users) } + subject(:user_store) { object_store.fetch(:users) } - let(:user) { mapper.where(id: "users/1").first } + let(:user) { user_store.where(id: "users/1").first } let(:post) { user.posts.first } context "when using arbitrary where query" do it "returns the same object for a row's primary key" do expect( @@ -44,10 +42,10 @@ ).to be(user) end end context "when eager loading" do - let(:user_query) { mapper.where(id: "users/1") } + let(:user_query) { user_store.where(id: "users/1") } let(:eager_category) { user_query .eager_load(:posts => { :categories => { :posts => [] }}) .first