Carlos Chitty
17a5b5e620
autocorrect Style/ArrayIntersect offenses
2025-04-29 14:20:50 -04:00
cyrillefr
84747ea064
Fix Rails::NegateInclude issues
...
- cop class: RuboCop::Cop::Rails::NegateInclude
- replaced !array.include?(2) by array.exclude?(2)
2024-04-04 14:42:42 +02:00
Neal Chambers
69e7419a45
Safely autocorrect Style/NegatedIfElseCondition
...
Inspecting 1509 files
....................................................................................................................................................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................
Offenses:
app/mailers/spree/shipment_mailer.rb:15:25: C: [Corrected] Style/NegatedIfElseCondition: Invert the negated condition and swap the ternary branches.
default_subject = !@delivery ? t('.picked_up_subject') : default_i18n_subject
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/matchers/table_matchers.rb:34:5: C: [Corrected] Style/NegatedIfElseCondition: Invert the negated condition and swap the if-else branches.
if rows.count != expected_table.count ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1509 files inspected, 2 offenses detected, 2 offenses corrected
2023-11-10 09:13:57 +09:00
Neal Chambers
728926cc9a
Fix Layout/LineLength
2023-07-19 08:39:26 +09:00
Neal Chambers
3432e30465
Fix Style/UnlessGuard
2023-06-08 15:20:04 +10:00
Maikel Linke
d7fa508b60
Remove unused matcher have_flash_message
2023-02-24 15:19:54 +11:00
cyrillefr
a75892ccc1
Remove I18n keys in support specs
2023-02-16 14:28:14 +01:00
Sebastian Castro
e9513f6172
Report Refactor 1: Enterprise Fee Summary
...
Disable enterprise fee summary spec for now
Will need to write them again
2022-05-12 16:54:13 +02:00
Luis Ramos
23627c5453
Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
...
9290 issues fixed
2021-06-17 22:19:26 +01:00
Pau Perez
d439a5074b
Remove unnecessary delegation specs
...
The custom RSpec matchers they use raises the following deprecation
warning
```
Using `stub` from rspec-mocks' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` instead. Called from /home/runner/work/openfoodnetwork/openfoodnetwork/spec/support/matchers/delegate_matchers.rb:22:in `block (2 levels) in <top (required)>'.
```
It's not worth maintaining those matchers to test such
implementation-related thing. Whether or not any delegations work is
something that will be caught by integration tests or directly stubbing
the collaborator object's methods.
This stems from
https://github.com/openfoodfoundation/openfoodnetwork/pull/6902 .
2021-03-02 11:54:46 +01:00
Luis Ramos
2b8f0abe49
Try some mass auto-correct adding frozen-string-literal to all specs
2020-12-03 06:38:24 -08:00
Arun Kumar Mohan
4b7d4ad960
Refactor select2 specs
2020-10-07 21:56:43 -05:00
Luis Ramos
23c86a1937
Replace select2_search usages with faster targetted_select2_search and remove select2_search and dependent code
2020-08-26 23:06:25 +01:00
luisramos0
86b0d71c7e
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
2019-05-28 12:57:29 +01:00
Pau Pérez Fabregat
a0c144fd0c
Merge pull request #3415 from openfoodfoundation/feature/enterprise_fee_summary
...
[Enterprise Fee Summary] Merge "Enterprise Fee Summary" report to master
2019-02-12 13:58:47 +01:00
Kristina Lim
e14c60c1c1
Add RSpec matchers for flash messages
2019-02-10 22:08:18 +08:00
Kristina Lim
519a7d2ee6
Add datetime and integer array validator matchers
2019-02-08 21:26:36 +00:00
Maikel Linke
1407ae7778
Make TableMatcher match exactly, not part of row
...
Reverts dbf3a7aaaf9d458f99e14983ca9db2d4cbe4b564.
The reverted commit tried to avoid a 30 second delay by using
have_selector. While that was successful in reducing test time, it made
the matcher find rows that where not exactly the wanted row, but contained
text of the wanted row. This wasn't a problem until we experimented with
Chrome as test browser returns text on select boxes.
This commit makes the matcher precise again. We still have to deal with
the 30 second delay.
2019-01-16 16:21:30 +00:00
Rob Harrington
3b40ede0b8
Fix table row matchers
...
The matcher was silently failing on the check step (adding ~30 seconds to out specs each time it was used!), so I changed it to fail if the basic step does not succeed
2019-01-16 16:21:30 +00:00
Rob Harrington
c2432fab0b
Use all_options_absent method instead of poorly written no_options_present
...
SAVES 30 SECONDS FOR EVERY SPEC THAT IS IT USED IN!
2019-01-16 16:21:30 +00:00
Maikel Linke
600c8fcd4c
Send confirmation emails immediately
...
Using deferred methods on the user model breaks delayed jobs when the
user is deleted while the job still exists. We could create a proper job
referencing a user id for sending these emails instead. But since the
user has to wait for the confirmation email anyway, we can send it
within the current request. This should be revised if performance
becomes an issue.
Sending the email directly also has the advantage that we can tell the
user if emailing failed. See the following commits.
This change impacts a bunch of specs as we now need a working email
setup to create unconfirmed users. This commit introduces a custom
matcher to unify testing for confirmation emails.
2018-09-27 13:33:08 +10:00
Andy Palmer
131bf842a9
Update matchers to non-deprecated protocol
2017-11-10 08:47:12 +11:00
Rob Harrington
b277ff03ea
Rubocop: Auto-correct Style/TrailingBlankLines offences
2017-06-23 16:49:07 +10:00
Rohan Mitchell
977ff7b35d
Fix compatibility issues with new version of select2
2016-02-24 11:26:37 +11:00
Rohan Mitchell
76d4fbccf9
Use select2 for order cycle selection
2015-12-11 13:06:58 +11:00
Maikel Linke
ffa960b02e
Merge remote-tracking branch 'origin/xero-report' into combined/xero-report_show-order-without-distributor
2015-06-05 13:48:24 +10:00
Rohan Mitchell
0737ac8da0
Write an rspec table matcher that gives informative error messages
2015-05-15 12:35:14 +10:00
Rob Harrington
7a4f0e214c
Adding customers index view
2015-05-13 12:44:33 +10:00
Rob Harrington
1e1d52cc47
Adding 'selected' option to have_select2 matcher
2015-04-02 14:35:39 +11:00
Rohan Mitchell
4c9aa96b17
have_select2 can test for an exact set of options
2014-11-21 13:49:09 +11:00
Rohan Mitchell
d810388248
Add have_select2 capybara matcher
2014-11-21 13:49:09 +11:00
Rob Harrington
b5ef24bacb
table matchers use capybara matchers rather than wait_until with micro-sleep
2014-09-24 16:18:59 +10:00
Rohan Mitchell
76d1754c32
Reorder helper method at bottom
2014-05-21 15:11:14 +10:00
Rohan Mitchell
6026a74c73
Table matcher have_table_row does not wait for full duration on should_not
2014-05-21 14:59:24 +10:00
Rohan Mitchell
ba7e29074f
have_table_row waits
2014-05-21 11:29:11 +10:00
Rohan Mitchell
61af8204d9
Add spec matcher have_table_row
2014-05-21 11:29:11 +10:00
alexs
1ca306e09e
Added RSpec matchers to test delegations.
2013-08-09 13:14:49 +10:00