Commit graph

759 commits

Author SHA1 Message Date
Andrew Kvalheim
4df59d85e2 Add test of voting 2023-03-01 11:17:39 -08:00
Andrew Kvalheim
57e9135287 Use CSS-compatible row IDs in datatables
In CSS IDs may not begin with a number:

  - https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
2022-09-13 11:06:22 -07:00
Sasi Olin
d31233c033 Migrate to fontawesome 6 2022-05-18 06:33:47 +02:00
Henne Vogelsang
36b23ce25d
Make use of ENV.fetch 2022-05-06 14:53:57 +02:00
Henne Vogelsang
200d188af2
Remove superfluous specs
Neither `if` nor `ENV` need to be tested by us...
2022-05-06 14:26:51 +02:00
Sasi Olin
e85ecede4c Fix the test failures 2022-03-30 12:39:01 +02:00
Henne Vogelsang
85cae7d093
Merge pull request #2970 from AndrewKvalheim/safe_links_only
Correct use of Redcarpet’s `safe_links_only` flag
2022-03-29 15:11:58 +02:00
Andrew Kvalheim
685d79e44b Correct use of Redcarpet’s safe_links_only flag 2022-03-17 17:03:30 -07:00
Andrew Kvalheim
a281110b29 Add test of markdown link protocol sanitization 2022-03-17 16:44:27 -07:00
Andrew Kvalheim
e486ce55d7 Remove test of implementation details 2022-03-17 16:13:47 -07:00
Andrew Kvalheim
51e65003bd Add failing tests for survey creation and response
Removes optional attributes from default survey factory.
2022-03-16 13:37:00 -07:00
Henne Vogelsang
ed8a2696bb
Merge pull request #2968 from AndrewKvalheim/unskip-tests
Re-enable skipped tests
2022-03-15 17:14:45 +01:00
Andrew Kvalheim
7e9ce60293 Partially revert "Skip some failing specs..."
This reverts the skipping of tests by commit b688d353ac in:

  - `spec/models/user_spec.rb`
  - `spec/controllers/admin/users_controller_spec.rb`
  - `spec/datatables/user_datatable_spec.rb`
2022-03-08 17:18:34 -08:00
Andrew Kvalheim
4b9eb440f4 Partially revert "Skip some failing specs..."
This reverts the changes to `spec/features/versions_spec.rb` made in
commit b688d353ac, except for the change
that was proposed in issue #2703.
2022-03-08 16:26:29 -08:00
Henne Vogelsang
af657ca77f
Merge pull request #2964 from AndrewKvalheim/splashpage-form-test
Update tests of splashpage forms
2022-03-08 13:24:08 +01:00
Henne Vogelsang
b04ad33138
Merge pull request #2963 from AndrewKvalheim/ajax-datatables-rails-1
Update UserDatatable for ajax-datatables-rails 1
2022-03-08 13:22:33 +01:00
Andrew Kvalheim
e2bc6fc1c7 Fix bug in which role assignments aren’t tracked in version history
Resolves failing test `spec/features/versions_spec.rb:344`:

    1) Version display changes in users_role for conference role
       Failure/Error: expect(page).to have_text("added role cfp with ID #{user_role.id} to user #{user.name} in conference #{conference.short_title}")
         expected to find text "added role cfp with ID 2 to user name2 in conference fr_GAQ" in "OSEM\nname1\nAll Conferences\nOrganizations\nRevision History\nAll Conferences\nRevision History\nLog of changes made to conferences and associated resources\nShow\n10\n25\n50\n100\nAll\nentries\nSearch:\nID Description Actions\n18\nname2 signed up less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n17\nSomeone (probably via the console) updated is admin of user name1 less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n16\nname1 signed up less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n15\nSomeone (probably via the console) created new cfp for events in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n14\nSomeone (probably via the console) created new role volunteers_coordinator in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n13\nSomeone (probably via the console) created new role info_desk in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n12\nSomeone (probably via the console) created new role cfp in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n11\nSomeone (probably via the console) created new role organizer in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n10\nSomeone (probably via the console) created new difficulty level Hard in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\n9\nSomeone (probably via the console) created new difficulty level Medium in conference fr_GAQ less than a minute ago\n(May 1, 2014 00:01)\n\n\n\nView Changes\nRevert\nShowing 1 to 10 of 16 entries\nFirst\nPrevious\n1\n2\nNext\nLast\nThis tool is free software, released under the MIT license. You can run, copy, distribute, study, change and improve it. The source code and the developers are on GitHub."
       # ./spec/features/versions_spec.rb:350:in `block (2 levels) in <top (required)>'
2022-03-06 23:38:42 -08:00
Andrew Kvalheim
4403f1149d Update tests of splashpage forms
The splashpage forms and default configuration changed in 81853d1ef9.
2022-03-06 23:28:58 -08:00
Andrew Kvalheim
83636afee0 Update UserDatatable for ajax-datatables-rails 1
Resolves failing test `spec/datatables/user_datatable_spec.rb:97`:

    1) UserDatatable outputs recordsTotal
       Failure/Error: filter_records(fetch_records).unscope(:group, :select).count(:all)

       NotImplementedError:
         NotImplementedError
       # ./app/datatables/user_datatable.rb:59:in `records_filtered_count'
       # ./spec/datatables/user_datatable_spec.rb:95:in `block (3 levels) in <top (required)>'
       # ./spec/datatables/user_datatable_spec.rb:98:in `block (3 levels) in <top (required)>'

Details: https://github.com/jbox-web/ajax-datatables-rails/blob/v1.3.1/doc/migrate.md#to-migrate-from-v04x-to-v100

RegistrationDatatable has already been updated in 81853d1ef9.
2022-03-06 23:12:02 -08:00
Henne Vogelsang
81853d1ef9
Retire semantic_form_for
Also a buttload of form cleanups...
2022-02-24 15:52:34 +01:00
Henne Vogelsang
c436ae172c
Stop testing views
There is no logic involved in assigning a CSS class...
2022-02-23 14:36:07 +01:00
Henne Vogelsang
1ca6029edc
Update stripe/stripe-ruby-mock 2022-02-23 14:36:06 +01:00
Henne Vogelsang
85dae98a76
👋 update_attributes
You served us well...
2022-02-23 14:36:05 +01:00
Henne Vogelsang
ca80b753e7
Autocorrect Faker deprecations 2022-02-23 14:36:05 +01:00
Andrew Kvalheim
e30880229c Use be_successful instead of be_success
Rails 5.2 warns:

> The `success?` predicate is deprecated and will be removed in Rails 6.0.
> Please use `successful?` as provided by Rack::Response::Helpers.

RSpec correspondingly provides `be_successful`.
2022-01-23 14:06:02 -08:00
Henne Vogelsang
a662ed4cf8
Sanitize rendered markdown
Fixes #2892
2021-10-11 18:10:03 +02:00
Henne Vogelsang
7c1d3ce1c4
Run rails upgrade task
next bundle exec rails app:update
2021-08-18 15:36:54 +02:00
Henne Vogelsang
95609358ec
Merge pull request #2844 from hennevogel/refactoring/factory-linting
Validate factories exactly once
2021-08-18 15:36:23 +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
d19a53bd0e
Remove #abstract_word_count example
There is no logic in this method, just method chaining. This is a non-test.
2021-08-18 14:08:32 +02:00
Henne Vogelsang
0104671e01
Stop validating factories in specs
We do validate all of them in a before(:suite) already.
2021-08-18 14:03:14 +02:00
Henne Vogelsang
5cbd15eeef
Introduces next_rails 2021-08-17 14:05:19 +02:00
Henne Vogelsang
4e9e13e2fd
rspec exits with 1 for pending specs somehow... 2021-08-11 14:15:47 +02:00
Henne Vogelsang
2c520d9975
Switch to fenced code blocks in markdown
`:fenced_code_blocks:` Blocks delimited with 3 or more ~ or backticks will be considered as code, without the need to be indented. An optional language name may be added at the end of the opening fence for the code block.

`:disable_indented_code_blocks:` Do not parse usual markdown code blocks. Markdown converts text with four spaces at the front of each line to code blocks. This option prevents it from doing so. Recommended to use with fenced_code_blocks: true.

Fixes #2764
2021-07-09 11:17:52 +02:00
Andrew Kvalheim
e449d78e23
Resolve warning about test using not_to raise_error
Resolves:

> WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)`
> risks false positives, since literally any other error would cause the
> expectation to pass, including those raised by Ruby (e.g.
> NoMethodError, NameError and ArgumentError), meaning the code you are
> intending to test may not even get reached. Instead consider using
> `expect { }.not_to raise_error` or `expect { }.to
> raise_error(DifferentSpecificErrorClass)`.
2021-07-05 19:39:52 +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
7f1d3b923a
Merge pull request #2662 from AndrewKvalheim/issue-2661-workaround
Fix bug in test of animated form
2021-03-06 20:02:04 +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
07f1323eff
Fix bug in test of animated form
The help text for the event type field is animated using a technique
unaffected by `Capybara.disable_animation`. Wait for the animation.

Resolves: #2356
Works around: #2661
2021-03-06 19:43:35 +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
Espartaco Palma
5d79049e59
Linters gonna lint
I was not aware the linting was also applied to specs
2021-03-06 19:09:38 +01:00
Espartaco Palma
fd2635509f
Introducing delegation for city and country name (Conference - Venue
Using ActiveSupport delegate macro.
2021-03-06 19:06:36 +01:00
Henne Vogelsang
2b0a257090
Set cobertura as simplecove formatter in github actions 2021-03-06 18:37:04 +01:00
Stella Rouzi
cb7519f7a4
Check CfP existence in proposal form 2021-03-06 12:38:02 +01:00
Henne Vogelsang
823f41427f
Merge pull request #2591 from openSUSE/remove-travel-schedule
Remove travel schedule from registration
2021-03-06 05:04:07 +01:00