Skip to content

Rebase master to 4-0-dev #2159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 95 commits into from
Closed

Rebase master to 4-0-dev #2159

wants to merge 95 commits into from

Conversation

benoittgt
Copy link
Member

Hello

I wanted to fix the conflict on 4-0-dev but I am not sure I understand the current status of the branch when I see all of those changes.

Is there something wrong with #2071 (comment)

Do we prefer to cherry pick commit @JonRowe and @samphippen ? It should be awesome to release RSpec Rails 4.

benoittgt and others added 30 commits May 1, 2019 14:36
Fix:
Error: The `Layout/FirstParameterIndentation` cop has been renamed to `Layout/IndentFirstArgument`.
(obsolete configuration found in .rubocop_rspec_base.yml, please update it)
The `Layout/IndentArray` cop has been renamed to `Layout/IndentFirstArrayElement`.
(obsolete configuration found in .rubocop_rspec_base.yml, please update it)
Prevent webdrivers from using `&.` method on unsupported ruby.
RVM doesn't provide old Ruby binaries for newer Ubuntu distributions.
Until it's fixed, we need to use old Ubuntu distributions in CI.
Use trusty for TravisCI build
…07-08-for-master

Updates from rspec-dev (2019-07-08)
…07-24-for-master

Updates from rspec-dev (2019-07-24)
Sam Phippen and others added 26 commits August 21, 2019 07:27
* Add ActionMailbox spec helpers and test type

Adds the following helpers to example groups with `:type => :mailbox`

* process(mail_or_attributes) - send mail directly to the mailbox under test for
  `process`ing.
* receive_inbound_email(mail_or_attributes) - matcher for asserting whether incoming
  email would route to the mailbox under test.
* have_been_delivered - matcher for asserting whether an incoming email object was delivered.
* have_bounced - matcher for asserting whether an incoming email object has bounced.
* have_failed - matcher for asserting whether an incoming email object has failed.

Also adds an ActionMailbox test generator

* Add style changes from code review
- fix warnings for wrong namespaces
- fix safe navigation offense
- turn off frozen string literal cop
this provide parity with have_enqueued_job with partial arguments
which would be useful especially in negated case where
we want to make sure that absolutely no emails are enqueued
The previous documentation was old and was not clear enough to help
developers to understand properly how to test cookies inside a
controller test. Since then it is much easier to test cookies if you
stick to `cookies` and don't use `response.cookies`.

You can use response.cookies when you don't change cookies inside your
test.

```
def show
  cookies["user_name"] = nil
  head 200
end

RSpec.describe SignOutsController, type: :request do
  describe 'GET /signout' do
    it "clear cookie value" do
      get "/sign_out"

      expect(response.cookies["user_name"]).to eq(nil)
    end
  end
end
```

Use `cookies` to set and expect when you set cookies inside your test

```
def show
  cookies.delete("user_name")
  head 200
end

RSpec.describe SignOutsController, type: :request do
  describe 'GET /signout' do
    it "clear cookie value" do
      cookies["user_name"] = "Sam"

      get "/sign_out"

      expect(cookies["user_name"]).to eq("")
    end
  end
end
```

This is the prefered way and this is way it is documented like that.

Related:
- #1993
action-cable-testing migration, pt.1
- parameterized mailer when RAILS_VERSION >= 5.1
- unified mailer job when RAILS_VERSION >= 6.0
This feature test is filtered on @rails_post_5
@benoittgt benoittgt self-assigned this Aug 21, 2019
@benoittgt
Copy link
Member Author

Closing in favor of #2160

@benoittgt benoittgt closed this Aug 21, 2019
@benoittgt benoittgt deleted the rebase_4-0-dev branch August 21, 2019 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.