Commit Graph

75 Commits

Author SHA1 Message Date
Henne Vogelsang
988b3bf689 Autocorrect new rubocop offenses 2025-08-12 16:44:20 +02:00
Henne Vogelsang
df0b9ab356 Replace flash helper with "within"
So we can't forget to find "#flash" on the page ever again...
2025-08-06 13:11:48 +02:00
Henne Vogelsang
f6049d8af4 Allow more chromium URLs in webmock 2024-09-30 16:27:50 +02:00
Henne Vogelsang
559c2b9ab0 Allow more Webdrivers update URLs in spec
Follow advise from the webdrivers wiki
2024-06-24 15:51:32 +02:00
Henne Vogelsang
10f8c46119 Update rubocop-rails to version 2.24.1 2024-04-16 13:27:34 +02:00
Andrew Kvalheim
e01fd2d721 Add URLs to API responses
Resolves inability of API consumers to provide links to OSEM.
2023-03-04 10:15:56 -08:00
Henne Vogelsang
36b23ce25d Make use of ENV.fetch 2022-05-06 14:53:57 +02:00
Henne Vogelsang
7dbe2d19fe Move factory linting to CI cycle
No need to do this before each and every spec or example. Speeds
up suite and make things less fragile.
2021-08-18 14:38:55 +02:00
Henne Vogelsang
5cbd15eeef Introduces next_rails 2021-08-17 14:05:19 +02:00
Henne Vogelsang
58d51c6d25 Merge pull request #2648 from AndrewKvalheim/webmock-webdrivers
Resolve conflict between WebMock and Webdrivers
2021-03-06 21:38:06 +01:00
Henne Vogelsang
0729c6f6fe Merge pull request #2659 from AndrewKvalheim/transactional-tests
Use Rails transactional tests
2021-03-06 20:01:47 +01:00
Andrew Kvalheim
c3e02c20b9 Use Rails transactional tests
As of Rails 5.1:

  - Rails has built-in support for running tests within database
    transactions, so Database Cleaner is no longer needed for this.
  - Rails automatically shares the database connection across threads,
    so transactional_capybara is no longer needed.

Changes:

  - Enable `use_transactional_tests`.
  - Remove transactional_capybara.
  - Remove the Database Cleaner test wrapper.

This resolves:

  - transactional_capybara mismanages the shared database connection,
    causing the connection to falsely report as idle after the first
    test. At 6 minutes (idle_timeout + reaping_frequency) into testing,
    the connection is closed, causing e.g. `PG::ConnectionBad` errors.
2021-03-06 19:41:06 +01:00
Andrew Kvalheim
310fc8dc68 Fix bug in test database preparation
Presumably the intent of this was to clear the database and repopulate
it with seed data. `transaction` isn't the right strategy for this; it
just rolls back any existing transactions.
2021-03-06 19:41:06 +01:00
Andrew Kvalheim
2c8521a2e5 Remove redundant code
This functionality is provided by transactional_capybara.
2021-03-06 19:41:05 +01:00
Andrew Kvalheim
c0913ab723 Work around RuboCop false positive
Details: rubocop-hq/rubocop#7853
2021-03-06 19:38:47 +01:00
Andrew Kvalheim
0df16e4773 Fix bug in logging of screenshots of failed tests
Presumably this was a typo.
2021-03-06 19:38:47 +01:00
Andrew Kvalheim
fa129d218f Whitelist Webdrivers update URLs in WebMock
Resolves #2557:

    $ docker-compose run --rm osem bundle exec rspec --tag js
    …
    WebMock::NetConnectNotAllowedError

See titusfortner/webdrivers#109 for details.
2021-03-06 19:20:30 +01:00
Ana María Martínez Gómez
f4caf79218 Store screenshot when feature test fails
This is useful when debugging a failing test.

Co-authored-by: Stephan Kulow <stephan@kulow.org>
2019-03-15 22:13:40 +01:00
James Mason
4256cdc06b Adapt serializer specs to the new format 2018-11-20 17:30:56 -08:00
James Mason
0a5246388f Adapt tests to new, pickier Capybara 2018-11-19 15:10:14 -08:00
James Mason
287344e816 Capybara.save_path defaults to tmp/capybara 2018-11-19 15:10:14 -08:00
James Mason
a9e8498abe transactional db support for capybara tests! 2018-11-19 08:40:55 -08:00
James Mason
43bef689fc Rubocop autocorrections 2018-11-16 09:06:05 -08:00
Henne Vogelsang
64d8f05bdd Update FactoryBot strings & urls 2018-09-06 00:42:28 +02:00
Henne Vogelsang
0a19418d15 Replace All FactoryGirl Constant References 2018-09-06 00:42:28 +02:00
James Mason
6d31dfeef4 Add frozen_string_literal magic comment
re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment
2018-05-09 06:54:26 -07:00
James Mason
137d997793 Don't use external youtube resources in test
Resolves https://github.com/openSUSE/osem/issues/1986
2018-03-06 18:24:29 -08:00
siddhantbajaj
0496ed23e5 Improves test speed 2017-06-15 04:26:15 +05:30
divyanshumehta
cdf794ecbf Add Style/SelfAssignment Rubocop cop
The cop enforces use of self assignment operator E.g. a=a+2 gets
written as a+=2. Also the offenses listed in rubocop.todo.yml
have been corrected automatically with the --auto-correct option.
Fixes issue #1531
2017-06-14 09:22:19 +05:30
AEtherC0r3
95b88be061 Add tests for openid signup with every provider
The spec for omniauth doesn't test signup for every provider, and it
doesn't test if it has tests for all available providers
Also, we no longer use secrets

* Add model test to check if the omniauth providers have changed
* Test signup using every provider
* Replace secretswith environment variables
2017-05-06 10:37:58 +03:00
AEtherC0r3
9341edd9cb Change mock accounts credentials
The names and usernames don't follow a canonical pattern
And the emails point to a valid domain not owned by osem and not
reserved for illustration purposes

Normalize the users' names and usernames and change the domain of the
email addresses to example.com

Fix #1365
2017-05-06 10:37:58 +03:00
Sunny
03fa299058 enable style/dotposition rubocop cop 2017-04-06 23:19:58 -04:00
Christian Bruckmayer
322d58c61c Revert "fixed travis issues"
This reverts commit 1255088ff0.

Because it broke our heroku deployment
2017-03-03 15:07:54 +01:00
Siddhant Bajaj
1255088ff0 fixed travis issues 2017-02-20 23:43:02 +05:30
Ana María Martínez Gómez
e4104ba2cd Fix the Travis failures in rspec 2017-01-11 10:07:25 +01:00
Ana María Martínez Gómez
7ebf44d1e4 Improvements in the DatabaseCleaner
Move all what is related to the DatabaseCleaner to the
database_cleaner.rb file. Load the seeds only when they have been
deleted and not before every test.
2017-01-11 10:03:27 +01:00
richiethomas
daf1f805bd Rename 'ConferenceController' to 'ConferencesController', and 'ProposalController' to 'ProposalsController' 2016-09-30 18:49:44 -04:00
Hernan Schmidt
4d6868d9bb Fix conference serializer spec to work with MySQL 2016-08-18 18:34:50 +02:00
Hernan Schmidt
244172a9bc Clean up DatabaseCleaner usage 2016-08-18 18:32:06 +02:00
Rishabh Saxena
4152cb242c run stripe feature test only if key is set 2016-08-17 23:57:40 +05:30
Rishabh Saxena
cc09dd76ba support/external_request: only allow stripe 2016-08-17 12:25:49 +05:30
Rishabh Saxena
75e11223d2 spec/feature: add stripe integration tests 2016-08-16 00:46:11 +05:30
Henne Vogelsang
084ee7ef43 Give a bit more demo info in the conference description 2016-05-03 16:25:39 +02:00
Henne Vogelsang
40562334c7 Make rubocop happy again 2016-05-02 16:06:32 +02:00
Henne Vogelsang
dd5796bd34 Fix saving feature failures to tmp/capybara 2016-05-02 16:06:32 +02:00
Henne Vogelsang
77e0340387 Make use of fake data in factories 2016-05-02 16:06:27 +02:00
Henne Vogelsang
bd36ce0fb2 Switch logic for linting factories
Only if you set the environment variable OSEM_FACTORY_LINT
to 'false' it won't lint.
2016-04-29 16:36:47 +02:00
Aditya Prakash
6301072484 Add webmock for external requests in tests
external_request.rb needs to be required before lint is run.
2016-03-02 21:15:29 +05:30
Aditya Prakash
640be7497f Add config to allow running FactoryGirl lint before suit
By default the lint will be run before every test suit.
Set it to false in config.yml if you would rather just use the rake
task: `bundle exec rake factory_girl:lint`
2016-03-02 21:15:29 +05:30
Aditya Prakash
f84150362b Move FactoryGirl.lint to rake task
This significantly improves start time of tests. It is also the recommended
way: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#linting-factories

Read more at: https://github.com/thoughtbot/factory_girl/issues/772
2016-03-02 21:15:28 +05:30