Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

ch.12 - "more concise" in details? #109

Open
JunichiIto opened this issue May 19, 2014 · 0 comments
Open

ch.12 - "more concise" in details? #109

JunichiIto opened this issue May 19, 2014 · 0 comments

Comments

@JunichiIto
Copy link

Technically speaking, we could also use the more concise expect(...).to be and expect(...).to_not be as well.

I am not sure what this sentence means. Do you mean you can change to be_falsey to to_not be_truethy , like this?

    describe "POST #create" do
      context "with valid attributes" do
        # ...

        it "creates a new contact" do
          expect(Contact.exists?(assigns[:contact])).to be_truthy
        end
      end

      context "with invalid attributes" do
        # ...

        it "does not save the new contact" do
          expect(Contact.exists?(contact)).to_not be_truthy
        end

        # ...
      end
    end

If so, I prefer to be_falsey because it is more readable for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant