aggregate_failures with assert_select

10 views
Skip to first unread message

Руслан Корнев

unread,
Dec 18, 2020, 10:31:33 PM12/18/20
to rspec
Hi! It seems that `aggregate_failures` doesn't work with `assert_select`? Or I am doing something wrong?

```
aggregate_failures do
  expect(true).to eq(false)
  expect(true).to eq(nil)
end
```

returns

```
0.1) Failure/Error: expect(true).to eq(false)

            expected: false
                 got: true

            (compared using ==)

            Diff:
            @@ -1 +1 @@
            -false
            +true
          # ./spec/requests/tables/news_controller_spec.rb:63:in `block (5 levels) in <top (required)>'

     0.2) Failure/Error: expect(true).to eq(nil)

            expected: nil
                 got: true

            (compared using ==)
          # ./spec/requests/tables/news_controller_spec.rb:64:in `block (5 levels) in <top (required)>'
```

but

```
aggregate_failures do
  assert_select 'h1', 'Newss'
  assert_select 'h2', count: 4
end

```

returns only:

```
Minitest::Assertion: <Newss> expected but was
<News>..
Expected 0 to be >= 1.

  0) Tables::NewsController#index with follow_redirect! has correct title
     Failure/Error: assert_select 'h1', 'Newss'

     Minitest::Assertion:
       <Newss> expected but was
       <News>..
       Expected 0 to be >= 1.
     # ./spec/requests/tables/news_controller_spec.rb:63:in `block (5 levels) in <top (required)>'
```

Any thoughts? thank you

Jon Rowe

unread,
Dec 18, 2020, 10:51:25 PM12/18/20
to rs...@googlegroups.com
Hello!

Thats highly likely an edgewise with our mini test integration, can you open an issue on rspec-core?

Руслан Корнев

unread,
Dec 19, 2020, 7:30:02 AM12/19/20
to rs...@googlegroups.com
Sure. Tomorrow. Thanks!

сб, 19 дек. 2020 г., 06:51 Jon Rowe <ma...@jonrowe.co.uk>:
--
You received this message because you are subscribed to a topic in the Google Groups "rspec" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rspec/4Xj5BatQyjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-fd5e529e-02f4-4adf-8c22-915da7f39fa0%40jonrowe.co.uk.

Руслан Корнев

unread,
Dec 21, 2020, 3:42:58 PM12/21/20
to rspec
Issue created https://github.com/rspec/rspec-core/issues/2807

суббота, 19 декабря 2020 г. в 15:30:02 UTC+3, Руслан Корнев:
Reply all
Reply to author
Forward
0 new messages