Sha256: 59391c980f00b8f602ed57d56ca93791f1f5b3cd0df8cb8f0ecf66297abb28a6

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

require "spec_helper"
require "fixtures/post"

describe ElabsMatchers::Matchers::Persist do
  let(:post) { ElabsMatchers::Orm::Post.create(:title => "New", :body => "Lorem") }
  subject { post }

  describe "#persist" do
    it "returns true if the value is the supplied" do
      should persist(:title, "Updated")
      expect { should_not persist(:title, "Updated") }.to fail_assertion
    end

    it "returns false if the value isn't the supplied" do
      allow(post).to receive(:title).and_return("New")

      should_not persist(:title, "Updated")
      expect { should persist(:title, "Updated") }.to fail_assertion
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elabs_matchers-2.0.1 spec/elabs_matchers/matchers/persist_spec.rb
elabs_matchers-2.0.0 spec/elabs_matchers/matchers/persist_spec.rb