diff --git a/.dockerignore b/.dockerignore index 7e7192a0b..add2862b6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,6 @@ .bundle/cache .git/ coverage/ -db/*.sqlite3 Dockerfile docker-compose.* log/ diff --git a/.github/workflows/next-rails.yml b/.github/workflows/next-rails.yml index 60d9df8a0..5342dab15 100644 --- a/.github/workflows/next-rails.yml +++ b/.github/workflows/next-rails.yml @@ -12,14 +12,14 @@ jobs: runs-on: ubuntu-latest name: next-rails env: - OSEM_DB_ADAPTER: sqlite3 + OSEM_DB_HOST: localhost RAILS_ENV: test strategy: matrix: suite: [models, features, controllers, ability, leftovers] fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Sets env vars for next-rails run: | echo "BUNDLE_GEMFILE=Gemfile.next" >> $GITHUB_ENV @@ -29,7 +29,6 @@ jobs: bundler-cache: true - name: Prepare spec run: | - rm -f osem_test osem_development bundle exec rake db:setup --trace bundle exec bin/rails webdrivers:chromedriver:update - name: spec/${{ matrix.suite }} @@ -40,3 +39,15 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: coverage/coverage.xml + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_PASSWORD: mysecretpassword + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index ed871fe2f..cb745e27d 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -13,7 +13,7 @@ jobs: PRONTO_PULL_REQUEST_ID: "${{ github.event.pull_request.number }}" PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: bundler-cache: true @@ -27,7 +27,10 @@ jobs: runs-on: ubuntu-latest name: spec env: - OSEM_DB_ADAPTER: sqlite3 + OSEM_DB_HOST: localhost + OSEM_DB_PASSWORD: mysecretpassword + OSEM_DB_USERNAME: postgres + OSEM_DB_NAME: osem_test RAILS_ENV: test CCTR: ./cc-test-reporter CCTR_ID: ${{ secrets.CC_TEST_REPORTER_ID }} @@ -35,7 +38,7 @@ jobs: matrix: suite: [models, features, controllers, ability, leftovers, cucumber] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: bundler-cache: true @@ -46,40 +49,51 @@ jobs: - run: sudo apt-get install xvfb - name: Install JavaScript libraries via npm run: npm install - # - name: set up CodeClimate test-reporter - # run: | - # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR - # chmod +x $CCTR - # $CCTR before-build - name: Prepare spec run: | - rm -f osem_test osem_development bundle exec rake db:setup --trace bundle exec bin/rails webdrivers:chromedriver:update - bundle exec rake factory_bot:lint RAILS_ENV=test - # TODO: Not all suites need xvfb + # FIXME: This flickers... + # bundle exec rake factory_bot:lint RAILS_ENV=test --trace - name: spec/${{ matrix.suite }} + run: bundle exec rake spec:${{ matrix.suite }} + - name: format code coverage run: | xvfb-run --auto-servernum bundle exec rake spec:${{ matrix.suite }} - # - name: format code coverage - # run: | - # $CCTR format-coverage --output coverage/codeclimate.${{ matrix.suite }}.json --input-type simplecov - # - name: coverage upload ${{ matrix.suite }} - # uses: codacy/codacy-coverage-reporter-action@v1 - # if: github.ref == 'refs/heads/master' && always() - # with: - # project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - # coverage-reports: coverage/coverage.xml - name: Upload Capybara Failure Screenshots uses: actions/upload-artifact@v4 if: always() with: - name: capybara-screenshots - path: tmp/capybara/ - retention-days: 7 + name: logs-${{ matrix.suite }} + path: | + log/ + tmp/capybara + - name: coverage upload ${{ matrix.suite }} + uses: codacy/codacy-coverage-reporter-action@master + if: github.ref == 'refs/heads/master' + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: coverage/coverage.xml + # with: + # name: capybara-screenshots + # path: tmp/capybara/ + # retention-days: 7 # - name: Publish code coverage # run: | # export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" # $CCTR sum-coverage coverage/codeclimate.*.json # $CCTR upload-coverage --id "6d21ff1a59b134f3741779d50325f7bd5183cbe6b205051573d955705148960f" # $CCTR after-build --id "6d21ff1a59b134f3741779d50325f7bd5183cbe6b205051573d955705148960f" + + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_PASSWORD: mysecretpassword + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 diff --git a/.gitignore b/.gitignore index 551ac3e65..067f4b68e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,13 +12,6 @@ Desktop.ini ._* Thumbs.db -# Files that might appear on external disks -.Spotlight-V100 -.Trashes - - -# Legacy from before Feb 2021 -/db/test.sqlite3-journal config/application.rb config/config.yml config/local_env.yml @@ -39,7 +32,6 @@ capybara-*.html /vendor/bundle /log/* /tmp/* -/db/*.sqlite3 /public/system/* /coverage/ /spec/tmp/* @@ -126,8 +118,9 @@ build-iPhoneSimulator/ # common db things from heroku latest.dump* + .ackrc -spec/support/deprecation_shitlist.json -.vs/* +spec/support/deprecation_shitlist.json cc-test-reporter +.vscode diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 93b401d76..004f46db2 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2021-08-13 13:00:39 +0000 using Haml-Lint version 0.28.0. +# on 2024-03-26 11:01:18 +0000 using Haml-Lint version 0.57.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -8,7 +8,11 @@ linters: - # Offense count: 1141 + # Offense count: 401 + InstanceVariables: + enabled: false + + # Offense count: 1378 RuboCop: enabled: false @@ -28,15 +32,11 @@ linters: - "app/views/admin/versions/_object_desc_and_link.html.haml" - "app/views/booths/index.html.haml" - # Offense count: 981 + # Offense count: 967 LineLength: enabled: false - # Offense count: 206 - InstanceVariables: - enabled: false - - # Offense count: 12 + # Offense count: 13 ViewLength: exclude: - "app/views/admin/booths/index.html.haml" @@ -50,9 +50,9 @@ linters: - "app/views/admin/versions/_object_desc_and_link.html.haml" - "app/views/conference_registrations/show.html.haml" - "app/views/layouts/_admin_sidebar.html.haml" + - "app/views/proposals/_form.html.haml" - "app/views/proposals/index.html.haml" - "app/views/proposals/show.html.haml" - - "app/views/proposals/_form.html.haml" # Offense count: 28 IdNames: @@ -70,21 +70,34 @@ linters: - "app/views/admin/users/show.html.haml" - "app/views/users/edit.html.haml" - # Offense count: 38 + # Offense count: 37 InlineStyles: enabled: false - # Offense count: 3 + # Offense count: 378 + SpaceInsideHashAttributes: + enabled: false + + # Offense count: 10 + TrailingEmptyLines: + exclude: + - "app/views/admin/conferences/_form_fields.html.haml" + - "app/views/admin/events/_all_with_comments.csv.haml" + - "app/views/admin/events/_form.html.haml" + - "app/views/admin/events/_proposal.html.haml" + - "app/views/admin/schedules/_form.html.haml" + - "app/views/admin/sponsorship_levels/_form.html.haml" + - "app/views/application/_big_statistic.haml" + - "app/views/booths/_form.html.haml" + - "app/views/schedules/_schedule_item.html.haml" + - "app/views/users/edit.html.haml" + + # Offense count: 1 UnnecessaryInterpolation: exclude: - "app/views/admin/conferences/_recent_submissions.html.haml" - - "app/views/proposals/new.html.haml" - - # Offense count: 262 - SpaceInsideHashAttributes: - enabled: false - # Offense count: 24 + # Offense count: 21 ClassesBeforeIds: exclude: - "app/views/admin/emails/index.html.haml" @@ -94,11 +107,9 @@ linters: - "app/views/admin/venues/_form.html.haml" - "app/views/conferences/index.html.haml" - "app/views/devise/shared/_help.html.haml" - - "app/views/devise/shared/_sign_in_form_embedded.html.haml" - "app/views/layouts/_navigation.html.haml" - - "app/views/proposals/_form.html.haml" - # Offense count: 19 + # Offense count: 16 UnnecessaryStringOutput: exclude: - "app/views/admin/event_types/index.html.haml" @@ -108,15 +119,13 @@ linters: - "app/views/admin/versions/_object_desc_and_link.html.haml" - "app/views/admin/volunteers/show.html.haml" - "app/views/conference_registrations/show.html.haml" - - "app/views/conferences/_conference_details.html.haml" - "app/views/proposals/_encouragement_text.html.haml" - - "app/views/proposals/_form.html.haml" - - "app/views/users/edit.html.haml" - "app/views/users/show.html.haml" - # Offense count: 31 - SpaceBeforeScript: - enabled: false + # Offense count: 1 + ImplicitDiv: + exclude: + - "app/views/admin/registrations/index.html.haml" # Offense count: 9 MultilinePipe: @@ -134,10 +143,13 @@ linters: - "app/views/layouts/_navigation.html.haml" - "app/views/schedules/events.html.haml" - # Offense count: 7 + # Offense count: 30 + SpaceBeforeScript: + enabled: false + + # Offense count: 5 TrailingWhitespace: exclude: - - "app/views/admin/volunteers/index.html.haml" - "app/views/admin/volunteers/show.html.haml" - "app/views/conference_registrations/_volunteer.html.haml" - "app/views/devise/passwords/new.html.haml" diff --git a/.rubocop.yml b/.rubocop.yml index 53babd565..bbc3e7389 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ -require: +plugins: - rubocop-rspec + - rubocop-rspec_rails - rubocop-rails - rubocop-capybara - rubocop-performance diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6f94f9d78..a97f9f932 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-03-12 05:45:42 UTC using RuboCop version 1.61.0. +# on 2025-08-12 15:04:30 UTC using RuboCop version 1.79.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 3 +# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemfile, **/Gemfile, **/gems.rb @@ -14,45 +14,47 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 180 +# Offense count: 176 # Configuration parameters: EnforcedStyle. # SupportedStyles: link_or_button, strict Capybara/ClickLinkOrButtonStyle: Enabled: false -# Offense count: 77 +# Offense count: 279 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: have_no, not_to Capybara/NegationMatcher: Exclude: - - 'spec/features/cfp_ability_spec.rb' - - 'spec/features/code_of_conduct_spec.rb' - - 'spec/features/info_desk_ability_spec.rb' - - 'spec/features/organizer_ability_spec.rb' - 'spec/features/proposals_spec.rb' - 'spec/features/splashpage_spec.rb' - - 'spec/features/sponsor_spec.rb' - - 'spec/features/track_organizer_ability_spec.rb' -# Offense count: 10 +# Offense count: 12 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: DefaultSelector. Capybara/RSpec/HaveSelector: Exclude: - 'spec/features/cfp_ability_spec.rb' - 'spec/features/info_desk_ability_spec.rb' - - 'spec/features/organization_admin_ability_spec.rb' - 'spec/features/organizer_ability_spec.rb' - 'spec/features/proposals_spec.rb' - 'spec/features/sponsor_spec.rb' - 'spec/features/track_organizer_ability_spec.rb' - 'spec/features/voting_spec.rb' -# Offense count: 101 +# Offense count: 17 # This cop supports safe autocorrection (--autocorrect). Capybara/SpecificFinders: - Enabled: false + Exclude: + - 'spec/features/difficulty_levels_spec.rb' + - 'spec/features/email_spec.rb' + - 'spec/features/event_types_spec.rb' + - 'spec/features/program_spec.rb' + +# Offense count: 1 +Capybara/SpecificMatcher: + Exclude: + - 'spec/features/sponsor_spec.rb' # Offense count: 8 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -66,7 +68,7 @@ FactoryBot/AssociationStyle: - 'spec/factories/surveys.rb' - 'spec/factories/tracks.rb' -# Offense count: 4 +# Offense count: 3 # Configuration parameters: Include. # Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb FactoryBot/FactoryAssociationWithStrategy: @@ -74,12 +76,200 @@ FactoryBot/FactoryAssociationWithStrategy: - 'spec/factories/booths.rb' - 'spec/factories/users.rb' -# Offense count: 13 +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'spec/features/cfp_ability_spec.rb' + - 'spec/features/info_desk_ability_spec.rb' + - 'spec/features/organizer_ability_spec.rb' + - 'spec/features/ticket_purchases_spec.rb' + - 'spec/features/track_organizer_ability_spec.rb' + - 'spec/features/user_ability_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'app/models/payment.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/views/admin/events/_all_with_comments.xlsx.axlsx' + - 'db/migrate/20140623101032_create_ahoy_events.rb' + - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' + - 'db/migrate/20140719160903_create_delayed_jobs.rb' + - 'spec/models/conference_spec.rb' + +# Offense count: 42 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstArgumentIndentation: + Enabled: false + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/FirstArrayElementIndentation: + Exclude: + - 'app/models/conference.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_braces +Layout/FirstHashElementIndentation: + Exclude: + - 'app/models/user.rb' + - 'config/routes.rb' + - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'app/controllers/users_controller.rb' + - 'app/models/event.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: IndentationWidth, EnforcedStyle. +# SupportedStyles: spaces, tabs +Layout/IndentationStyle: + Exclude: + - 'app/controllers/admin/resources_controller.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, AllowedPatterns. +Layout/IndentationWidth: + Exclude: + - 'app/controllers/users_controller.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment, AllowRBSInlineAnnotation, AllowSteepAnnotation. +Layout/LeadingCommentSpace: + Exclude: + - 'app/models/comment.rb' + +# Offense count: 18 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/LineContinuationSpacing: + Exclude: + - 'app/controllers/admin/booths_controller.rb' + - 'app/controllers/admin/cfps_controller.rb' + - 'app/controllers/admin/commercials_controller.rb' + - 'app/controllers/admin/difficulty_levels_controller.rb' + - 'app/controllers/admin/event_types_controller.rb' + - 'app/controllers/admin/registrations_controller.rb' + - 'app/controllers/admin/splashpages_controller.rb' + - 'app/controllers/admin/venue_commercials_controller.rb' + - 'app/controllers/admin/venues_controller.rb' + - 'app/controllers/conference_registrations_controller.rb' + - 'app/models/cfp.rb' + +# Offense count: 31 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Enabled: false + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineArrayBraceLayout: + Exclude: + - 'app/controllers/conference_registrations_controller.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +Layout/MultilineBlockLayout: + Exclude: + - 'app/serializers/conference_serializer.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineHashBraceLayout: + Exclude: + - 'app/serializers/conference_serializer.rb' + - 'config/routes.rb' + - 'spec/models/event_spec.rb' + +# Offense count: 32 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Enabled: false + +# Offense count: 32 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'app/controllers/admin/conferences_controller.rb' + - 'app/controllers/admin/reports_controller.rb' + - 'app/controllers/conference_registrations_controller.rb' + - 'app/datatables/user_datatable.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/cfp.rb' + - 'app/models/conference.rb' + - 'app/models/event.rb' + - 'app/models/registration_period.rb' + - 'spec/controllers/admin/conferences_controller_spec.rb' + - 'spec/controllers/schedules_controller_spec.rb' + - 'spec/models/conference_spec.rb' + - 'spec/support/external_request.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/MultilineOperationIndentation: + Exclude: + - 'app/models/conference.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'spec/ability/ability_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'spec/ability/ability_spec.rb' + +# Offense count: 11 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedMethods, AllowedPatterns. Lint/AmbiguousBlockAssociation: Exclude: - - 'spec/controllers/admin/conferences_controller_spec.rb' - 'spec/controllers/admin/event_schedules_controller_spec.rb' - 'spec/controllers/admin/registration_periods_controller_spec.rb' - 'spec/controllers/admin/users_controller_spec.rb' @@ -87,8 +277,27 @@ Lint/AmbiguousBlockAssociation: - 'spec/controllers/schedules_controller_spec.rb' - 'spec/models/user_spec.rb' -# Offense count: 3 -# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'app/controllers/application_controller.rb' + - 'app/helpers/conference_helper.rb' + - 'app/models/admin_ability.rb' + - 'app/models/commercial.rb' + - 'app/models/conference.rb' + - 'app/models/track.rb' + - 'app/pdfs/ticket_pdf.rb' + +# Offense count: 1 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'lib/tasks/data.rake' + +# Offense count: 5 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch. Lint/DuplicateBranch: Exclude: - 'app/helpers/format_helper.rb' @@ -100,28 +309,57 @@ Lint/IneffectiveAccessModifier: - 'app/models/commercial.rb' - 'app/models/conference.rb' -# Offense count: 110 +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/NonAtomicFileOperation: + Exclude: + - 'spec/support/save_feature_failures.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'lib/tasks/user.rake' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions. +# NotImplementedExceptions: NotImplementedError +Lint/UnusedMethodArgument: + Exclude: + - 'app/helpers/application_helper.rb' + - 'config/initializers/fuckups.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Lint/UriRegexp: + Exclude: + - 'app/models/commercial.rb' + - 'app/models/contact.rb' + +# Offense count: 124 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Max: 72 + Max: 70 # Offense count: 14 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: - Max: 99 + Max: 98 -# Offense count: 13 +# Offense count: 15 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 270 + Max: 655 -# Offense count: 28 +# Offense count: 24 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: Max: 15 -# Offense count: 126 +# Offense count: 150 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 55 @@ -129,14 +367,14 @@ Metrics/MethodLength: # Offense count: 4 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 158 + Max: 166 Exclude: - app/helpers/format_helper.rb -# Offense count: 27 +# Offense count: 24 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: - Max: 17 + Max: 16 # Offense count: 13 Naming/AccessorMethodName: @@ -159,13 +397,23 @@ Naming/MethodParameterName: Exclude: - 'app/models/conference.rb' +# Offense count: 3 +# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates. +# AllowedMethods: call +# WaywardPredicates: nonzero? +Naming/PredicateMethod: + Exclude: + - 'app/helpers/conference_helper.rb' + - 'app/helpers/format_helper.rb' + - 'config/initializers/fuckups.rb' + # Offense count: 2 -# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. -# NamePrefix: is_, has_, have_ -# ForbiddenPrefixes: is_, has_, have_ +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs. +# NamePrefix: is_, has_, have_, does_ +# ForbiddenPrefixes: is_, has_, have_, does_ # AllowedMethods: is_a? # MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: +Naming/PredicatePrefix: Exclude: - 'app/models/comment.rb' - 'app/models/contact.rb' @@ -173,7 +421,7 @@ Naming/PredicateName: # Offense count: 9 # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 +# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'app/models/program.rb' @@ -181,17 +429,12 @@ Naming/VariableNumber: - 'spec/models/payment_spec.rb' - 'spec/models/ticket_purchase_spec.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Performance/Casecmp: - Exclude: - - 'config/environments/production.rb' - -# Offense count: 1 +# Offense count: 2 # Configuration parameters: MinSize. Performance/CollectionLiteralInLoop: Exclude: - 'app/models/conference.rb' + - 'db/migrate/20140730104658_migrate_roles_for_cancancan.rb' # Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -206,12 +449,6 @@ Performance/MapCompact: Exclude: - 'app/datatables/registration_datatable.rb' -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -Performance/StringInclude: - Exclude: - - 'app/models/commercial.rb' - # Offense count: 32 RSpec/AnyInstance: Exclude: @@ -226,48 +463,44 @@ RSpec/AnyInstance: # Offense count: 5 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/BeEmpty: Exclude: - 'spec/controllers/conference_registration_controller_spec.rb' - 'spec/models/conference_spec.rb' -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnabledMethods. -RSpec/Capybara/FeatureMethods: - Exclude: - - 'spec/features/proposals_spec.rb' - - 'spec/features/user_spec.rb' - - 'spec/features/voting_spec.rb' - -# Offense count: 339 +# Offense count: 298 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Enabled: false -# Offense count: 141 +# Offense count: 138 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: SkipBlocks, EnforcedStyle. +# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Enabled: false -# Offense count: 251 +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterSubject: + Exclude: + - 'spec/ability/ability_spec.rb' + +# Offense count: 179 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 222 -# Offense count: 37 +# Offense count: 32 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: method_call, block RSpec/ExpectChange: Exclude: - 'spec/controllers/admin/booths_controller_spec.rb' - - 'spec/controllers/admin/conferences_controller_spec.rb' - 'spec/controllers/admin/event_schedules_controller_spec.rb' - - 'spec/controllers/admin/organizations_controller_spec.rb' - 'spec/controllers/admin/registration_periods_controller_spec.rb' - 'spec/controllers/admin/schedules_controller_spec.rb' - 'spec/controllers/admin/ticket_scannings_controller_spec.rb' @@ -279,34 +512,29 @@ RSpec/ExpectChange: - 'spec/models/event_spec.rb' - 'spec/models/user_spec.rb' -# Offense count: 9 -# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/FilePath: - Exclude: - - 'spec/controllers/conference_registration_controller_spec.rb' - - 'spec/controllers/physical_ticket_controller_spec.rb' - - 'spec/features/email_spec.rb' - - 'spec/features/omniauth_spec.rb' - - 'spec/features/proposals_spec.rb' - - 'spec/features/ticket_purchases_spec.rb' - - 'spec/features/venues_spec.rb' - - 'spec/models/comment_spec.rb' - - 'spec/models/openid.rb' - -# Offense count: 1 +# Offense count: 167 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, each, example RSpec/HookArgument: Exclude: + - 'spec/features/ticket_purchases_spec.rb' - 'spec/features/voting_spec.rb' + - 'spec/spec_helper.rb' # Offense count: 2 RSpec/IdenticalEqualityAssertion: Exclude: - 'spec/controllers/admin/conferences_controller_spec.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_expected, should +RSpec/ImplicitExpect: + Exclude: + - 'spec/ability/ability_spec.rb' + # Offense count: 53 # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. RSpec/IndexedLet: @@ -325,7 +553,7 @@ RSpec/IndexedLet: - 'spec/models/user_spec.rb' - 'spec/services/full_calendar_formatter_spec.rb' -# Offense count: 344 +# Offense count: 320 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: @@ -345,11 +573,19 @@ RSpec/InstanceVariable: - 'spec/models/track_spec.rb' - 'spec/models/user_spec.rb' -# Offense count: 64 +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +RSpec/LeadingSubject: + Exclude: + - 'spec/ability/ability_spec.rb' + - 'spec/models/conference_spec.rb' + - 'spec/models/ticket_spec.rb' + +# Offense count: 57 RSpec/LetSetup: Enabled: false -# Offense count: 4 +# Offense count: 3 # This cop supports safe autocorrection (--autocorrect). RSpec/MatchArray: Exclude: @@ -363,19 +599,26 @@ RSpec/MatchArray: RSpec/MessageSpies: EnforcedStyle: receive +# Offense count: 138 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: hash, symbol +RSpec/MetadataStyle: + Enabled: false + # Offense count: 1 RSpec/MultipleDescribes: Exclude: - 'spec/models/conference_spec.rb' -# Offense count: 300 +# Offense count: 229 RSpec/MultipleExpectations: - Max: 97 + Max: 94 -# Offense count: 274 +# Offense count: 212 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: - Max: 32 + Max: 31 # Offense count: 438 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. @@ -386,7 +629,6 @@ RSpec/NamedSubject: - 'spec/models/booth_spec.rb' - 'spec/models/conference_spec.rb' - 'spec/models/event_type_spec.rb' - - 'spec/models/organization_spec.rb' - 'spec/models/program_spec.rb' - 'spec/models/registration_period_spec.rb' - 'spec/models/registration_spec.rb' @@ -397,7 +639,7 @@ RSpec/NamedSubject: - 'spec/models/ticket_spec.rb' - 'spec/models/track_spec.rb' -# Offense count: 219 +# Offense count: 198 # Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 7 @@ -412,9 +654,27 @@ RSpec/NoExpectationExample: - 'spec/features/proposals_spec.rb' - 'spec/features/voting_spec.rb' +# Offense count: 24 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/controllers/admin/booths_controller_spec.rb' + - 'spec/controllers/admin/event_schedules_controller_spec.rb' + - 'spec/controllers/admin/registration_periods_controller_spec.rb' + - 'spec/controllers/admin/ticket_scannings_controller_spec.rb' + - 'spec/controllers/booths_controller_spec.rb' + - 'spec/features/tracks_spec.rb' + - 'spec/models/program_spec.rb' + - 'spec/models/track_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/pdfs/ticket_pdf_spec.rb' + # Offense count: 1 RSpec/OverwritingSetup: Exclude: + - 'spec/ability/ability_spec.rb' - 'spec/controllers/admin/booths_controller_spec.rb' # Offense count: 11 @@ -429,24 +689,6 @@ RSpec/PendingWithoutReason: # Offense count: 12 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Inferences. -RSpec/Rails/InferredSpecType: - Exclude: - - 'spec/controllers/admin/comments_controller_spec.rb' - - 'spec/controllers/admin/programs_controller_spec.rb' - - 'spec/controllers/application_controller_spec.rb' - - 'spec/controllers/conference_registration_controller_spec.rb' - - 'spec/features/omniauth_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/helpers/conference_helper_spec.rb' - - 'spec/helpers/date_time_helper_spec.rb' - - 'spec/helpers/events_helper_spec.rb' - - 'spec/helpers/format_helper_spec.rb' - - 'spec/helpers/users_helper_spec.rb' - - 'spec/routing/routing_spec.rb' - -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). RSpec/ReceiveMessages: Exclude: - 'spec/models/track_spec.rb' @@ -468,16 +710,38 @@ RSpec/RepeatedExampleGroupBody: # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/ScatteredSetup: Exclude: - 'spec/models/payment_spec.rb' -# Offense count: 32 +# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). RSpec/SortMetadata: Exclude: - 'spec/features/versions_spec.rb' +# Offense count: 8 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata. +# Include: **/*_spec.rb +RSpec/SpecFilePathFormat: + Exclude: + - 'spec/controllers/conference_registration_controller_spec.rb' + - 'spec/controllers/physical_ticket_controller_spec.rb' + - 'spec/features/email_spec.rb' + - 'spec/features/omniauth_spec.rb' + - 'spec/features/proposals_spec.rb' + - 'spec/features/ticket_purchases_spec.rb' + - 'spec/features/venues_spec.rb' + - 'spec/models/comment_spec.rb' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/*_spec*rb*, **/spec/**/* +RSpec/SpecFilePathSuffix: + Exclude: + - 'spec/models/openid.rb' + # Offense count: 9 RSpec/StubbedMock: Exclude: @@ -502,6 +766,458 @@ RSpec/VoidExpect: Exclude: - 'spec/models/conference_spec.rb' +# Offense count: 12 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Inferences. +RSpecRails/InferredSpecType: + Exclude: + - 'spec/controllers/admin/comments_controller_spec.rb' + - 'spec/controllers/admin/programs_controller_spec.rb' + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/conference_registration_controller_spec.rb' + - 'spec/features/omniauth_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/helpers/conference_helper_spec.rb' + - 'spec/helpers/date_time_helper_spec.rb' + - 'spec/helpers/events_helper_spec.rb' + - 'spec/helpers/format_helper_spec.rb' + - 'spec/helpers/users_helper_spec.rb' + - 'spec/routing/routing_spec.rb' + +# Offense count: 23 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: ExpectedOrder, Include. +# ExpectedOrder: index, show, new, edit, create, update, destroy +# Include: **/app/controllers/**/*.rb +Rails/ActionOrder: + Enabled: false + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ActiveRecordAliases: + Exclude: + - 'db/migrate/20141104131625_generate_username.rb' + - 'db/migrate/20141117214230_move_banner_description_to_conference.rb' + - 'db/migrate/20141118153918_change_venue_conference_association.rb' + - 'db/migrate/20141118162030_change_lodging_association_to_conference.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: **/app/models/**/*.rb +Rails/ActiveRecordCallbacksOrder: + Exclude: + - 'app/models/event.rb' + - 'app/models/track.rb' + - 'app/models/venue.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationController: + Exclude: + - 'app/controllers/api/base_controller.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationMailer: + Exclude: + - 'app/mailers/mailbot.rb' + +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationRecord: + Exclude: + - 'app/models/survey.rb' + - 'app/models/survey_question.rb' + - 'app/models/survey_reply.rb' + - 'app/models/survey_submission.rb' + - 'lib/tasks/data.rake' + +# Offense count: 10 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. +Rails/Blank: + Exclude: + - 'app/controllers/conferences_controller.rb' + - 'app/controllers/users/omniauth_callbacks_controller.rb' + - 'app/models/program.rb' + - 'app/models/user.rb' + - 'spec/factories/event_schedule.rb' + +# Offense count: 68 +# Configuration parameters: Database, Include. +# SupportedDatabases: mysql, postgresql +# Include: db/**/*.rb +Rails/BulkChangeTable: + Enabled: false + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/CompactBlank: + Exclude: + - 'app/controllers/surveys_controller.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Rails/ContentTag: + Exclude: + - 'app/helpers/application_helper.rb' + +# Offense count: 13 +# Configuration parameters: Include. +# Include: db/**/*.rb +Rails/CreateTableWithTimestamps: + Exclude: + - 'db/migrate/20121223115117_create_rooms_table.rb' + - 'db/migrate/20121223120413_create_event_types.rb' + - 'db/migrate/20130202130737_create_supporter_level_table.rb' + - 'db/migrate/20130202130923_create_table_supporter_registrations.rb' + - 'db/migrate/20130216070725_create_social_events_table.rb' + - 'db/migrate/20131228214532_create_vchoices.rb' + - 'db/migrate/20140109191145_create_qanswers.rb' + - 'db/migrate/20140623100942_create_visits.rb' + - 'db/migrate/20140623101032_create_ahoy_events.rb' + - 'db/migrate/20160309182642_remove_social_events_table.rb' + - 'db/migrate/20160628093634_create_survey_questions.rb' + - 'db/migrate/20170129075434_create_resources_table.rb' + - 'db/migrate/20170529215453_create_organizations.rb' + +# Offense count: 2 +# Configuration parameters: Severity, Include. +# Include: db/**/*.rb +Rails/DangerousColumnNames: + Exclude: + - 'db/migrate/20160403214841_add_id_and_created_at_to_events_registrations.rb' + - 'db/migrate/20160614145614_add_id_to_users_roles.rb' + +# Offense count: 103 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowToTime. +# SupportedStyles: strict, flexible +Rails/Date: + Enabled: false + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforceForPrefixed. +Rails/Delegate: + Exclude: + - 'app/models/event.rb' + - 'app/models/room.rb' + - 'app/models/track.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity. +Rails/DuplicateAssociation: + Exclude: + - 'app/models/program.rb' + - 'app/models/user.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Rails/DurationArithmetic: + Exclude: + - 'spec/models/program_spec.rb' + - 'spec/models/user_spec.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. +# Whitelist: find_by_sql, find_by_token_for +# AllowedMethods: find_by_sql, find_by_token_for +# AllowedReceivers: Gem::Specification, page +Rails/DynamicFindBy: + Exclude: + - 'app/controllers/admin/events_controller.rb' + - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +Rails/EagerEvaluationLogMessage: + Exclude: + - 'app/controllers/admin/events_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/proposals_controller.rb' + - 'app/models/event.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: **/app/models/**/*.rb +Rails/EnumHash: + Exclude: + - 'app/models/conference.rb' + - 'app/models/survey.rb' + - 'app/models/survey_question.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: slashes, arguments +Rails/FilePath: + Exclude: + - 'app/pdfs/ticket_pdf.rb' + - 'config/initializers/carrierwave.rb' + - 'lib/tasks/migrate_config.rake' + - 'spec/features/lodgings_spec.rb' + - 'spec/features/sponsor_spec.rb' + - 'spec/support/deprecation_shitlist.rb' + +# Offense count: 80 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods, AllowedPatterns. +# AllowedMethods: order, limit, select, lock +Rails/FindEach: + Enabled: false + +# Offense count: 6 +# Configuration parameters: Include. +# Include: **/app/models/**/*.rb +Rails/HasAndBelongsToMany: + Exclude: + - 'app/models/conference.rb' + - 'app/models/qanswer.rb' + - 'app/models/question.rb' + - 'app/models/registration.rb' + - 'app/models/vchoice.rb' + +# Offense count: 24 +# Configuration parameters: Include. +# Include: **/app/models/**/*.rb +Rails/HasManyOrHasOneDependent: + Enabled: false + +# Offense count: 5 +# Configuration parameters: Include. +# Include: **/app/helpers/**/*.rb +Rails/HelperInstanceVariable: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/events_helper.rb' + - 'app/helpers/format_helper.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: numeric, symbolic +Rails/HttpStatus: + Exclude: + - 'app/controllers/admin/commercials_controller.rb' + - 'app/controllers/admin/event_schedules_controller.rb' + - 'app/controllers/admin/programs_controller.rb' + - 'app/controllers/admin/tracks_controller.rb' + - 'app/controllers/admin/venue_commercials_controller.rb' + - 'app/controllers/commercials_controller.rb' + +# Offense count: 99 +Rails/I18nLocaleTexts: + Enabled: false + +# Offense count: 7 +# Configuration parameters: IgnoreScopes, Include. +# Include: **/app/models/**/*.rb +Rails/InverseOf: + Exclude: + - 'app/models/booth.rb' + - 'app/models/conference.rb' + - 'app/models/event.rb' + - 'app/models/user.rb' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/app/controllers/**/*.rb, **/app/mailers/**/*.rb +Rails/LexicallyScopedActionFilter: + Exclude: + - 'app/controllers/registrations_controller.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Rails/LinkToBlank: + Exclude: + - 'app/helpers/format_helper.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: **/app/mailers/**/*.rb +Rails/MailerName: + Exclude: + - 'app/mailers/mailbot.rb' + +# Offense count: 3 +Rails/OutputSafety: + Exclude: + - 'app/helpers/events_helper.rb' + - 'app/models/commercial.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: conservative, aggressive +Rails/PluckInWhere: + Exclude: + - 'app/models/ability.rb' + - 'app/models/admin_ability.rb' + +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +Rails/PluralizationGrammar: + Exclude: + - 'spec/models/conference_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Rails/Presence: + Exclude: + - 'app/controllers/schedules_controller.rb' + - 'app/models/user.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. +Rails/Present: + Exclude: + - 'app/models/cfp.rb' + - 'app/models/email_settings.rb' + - 'app/models/event.rb' + - 'app/models/program.rb' + - 'app/models/venue.rb' + +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: **/Rakefile, **/*.rake +Rails/RakeEnvironment: + Exclude: + - 'lib/tasks/spec.rake' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +# AllowedReceivers: ActionMailer::Preview, ActiveSupport::TimeZone +Rails/RedundantActiveRecordAllMethod: + Exclude: + - 'db/migrate/20160309182655_remove_dietary_choices_table.rb' + +# Offense count: 19 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/RedundantPresenceValidationOnBelongsTo: + Exclude: + - 'app/models/booth.rb' + - 'app/models/cfp.rb' + - 'app/models/comment.rb' + - 'app/models/contact.rb' + - 'app/models/event.rb' + - 'app/models/event_schedule.rb' + - 'app/models/events_registration.rb' + - 'app/models/payment.rb' + - 'app/models/qanswer.rb' + - 'app/models/question.rb' + - 'app/models/registration.rb' + - 'app/models/room.rb' + - 'app/models/sponsor.rb' + - 'app/models/survey_reply.rb' + - 'app/models/ticket_purchase.rb' + +# Offense count: 2 +Rails/RenderInline: + Exclude: + - 'app/controllers/conferences_controller.rb' + - 'app/controllers/schedules_controller.rb' + +# Offense count: 10 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: spec/controllers/**/*.rb, spec/requests/**/*.rb, test/controllers/**/*.rb, test/integration/**/*.rb +Rails/ResponseParsedBody: + Exclude: + - 'spec/controllers/api/v1/conferences_controller_spec.rb' + - 'spec/controllers/api/v1/events_controller_spec.rb' + - 'spec/controllers/api/v1/rooms_controller_spec.rb' + - 'spec/controllers/api/v1/speakers_controller_spec.rb' + - 'spec/controllers/api/v1/tracks_controller_spec.rb' + +# Offense count: 4 +# Configuration parameters: Include. +# Include: db/**/*.rb +Rails/ReversibleMigration: + Exclude: + - 'db/migrate/20170108053041_add_default_to_revision_in_conference.rb' + - 'db/migrate/20170715131706_make_track_state_not_null_and_add_default_value.rb' + - 'db/migrate/20170720134353_make_track_cfp_active_not_null.rb' + - 'db/migrate/20171118113113_change_visit_id_type_of_ahoy_events_to_integer.rb' + +# Offense count: 41 +# Configuration parameters: ForbiddenMethods, AllowedMethods. +# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all +Rails/SkipsModelValidations: + Enabled: false + +# Offense count: 77 +# Configuration parameters: Include. +# Include: db/**/*.rb +Rails/ThreeStateBooleanColumn: + Enabled: false + +# Offense count: 47 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: strict, flexible +Rails/TimeZone: + Exclude: + - 'app/models/comment.rb' + - 'app/models/conference.rb' + - 'config/environments/test.rb' + - 'db/migrate/20180226032958_add_created_at_and_updated_at_to_event_types.rb' + - 'db/migrate/20180313012253_add_timestamps_to_tickets.rb' + - 'spec/controllers/admin/comments_controller_spec.rb' + - 'spec/factories/users.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/models/conference_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity. +Rails/TopLevelHashWithIndifferentAccess: + Exclude: + - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' + +# Offense count: 12 +# Configuration parameters: Include. +# Include: **/app/models/**/*.rb +Rails/UniqueValidationWithoutIndex: + Exclude: + - 'app/models/booth.rb' + - 'app/models/cfp.rb' + - 'app/models/commercial.rb' + - 'app/models/conference.rb' + - 'app/models/events_registration.rb' + - 'app/models/registration.rb' + - 'app/models/role.rb' + - 'app/models/subscription.rb' + - 'app/models/survey_reply.rb' + - 'app/models/survey_submission.rb' + - 'app/models/track.rb' + - 'app/models/vote.rb' + +# Offense count: 17 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/WhereEquals: + Exclude: + - 'app/controllers/admin/registrations_controller.rb' + - 'app/models/admin_ability.rb' + - 'app/models/conference.rb' + - 'app/models/event_schedule.rb' + - 'app/models/program.rb' + - 'app/models/user.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Rails/WhereNot: + Exclude: + - 'db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb' + # Offense count: 3 Security/Open: Exclude: @@ -521,12 +1237,91 @@ Style/CaseLikeIf: Exclude: - 'app/views/admin/events/events.xlsx.axlsx' -# Offense count: 107 +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_a?, kind_of? +Style/ClassCheck: + Exclude: + - 'app/models/email_settings.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/ColonMethodCall: + Exclude: + - 'app/models/commercial.rb' + - 'app/models/contact.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/CombinableLoops: + Exclude: + - 'db/migrate/20140820093735_migrating_supporter_registrations_to_ticket_users.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: + Exclude: + - 'spec/controllers/admin/versions_controller_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'app/helpers/format_helper.rb' + - 'db/migrate/20140610165551_migrate_data_person_to_user.rb' + - 'db/migrate/20140820124117_undo_wrong_migration20140801080705_add_users_to_events.rb' + +# Offense count: 518 # Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false -# Offense count: 43 +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/EmptyCaseCondition: + Exclude: + - 'app/helpers/format_helper.rb' + - 'app/helpers/versions_helper.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/EmptyLiteral: + Exclude: + - 'spec/models/conference_spec.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'app/controllers/admin/lodgings_controller.rb' + - 'app/controllers/users_controller.rb' + - 'db/migrate/20121223115125_create_tracks_table.rb' + - 'db/migrate/20121223115135_create_events_table.rb' + - 'db/migrate/20130103134212_create_registrations_table.rb' + - 'db/migrate/20130206192339_rename_attending_social_events_with_partner.rb' + - 'db/migrate/20130216122155_set_registration_defaults_to_false.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/Encoding: + Exclude: + - 'app/uploaders/picture_uploader.rb' + - 'spec/models/conference_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/ExpandPathArguments: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 39 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -539,7 +1334,7 @@ Style/GlobalStdStream: Exclude: - 'config/environments/production.rb' -# Offense count: 36 +# Offense count: 33 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: @@ -551,6 +1346,18 @@ Style/HashLikeCase: Exclude: - 'app/helpers/versions_helper.rb' +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either, consistent, either_consistent +Style/HashSyntax: + Exclude: + - 'Gemfile' + - 'app/views/admin/events/events.xlsx.axlsx' + - 'app/views/admin/registrations/index.xlsx.axlsx' + - 'lib/tasks/user.rake' + # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Style/HashTransformValues: @@ -558,25 +1365,11 @@ Style/HashTransformValues: - 'app/controllers/admin/comments_controller.rb' - 'app/helpers/chart_helper.rb' -# Offense count: 4 -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/IdenticalConditionalBranches: - Exclude: - - 'app/controllers/admin/booths_controller.rb' - - 'app/controllers/admin/events_controller.rb' - -# Offense count: 34 +# Offense count: 54 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Enabled: false -# Offense count: 8 -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/LineEndConcatenation: - Exclude: - - 'spec/features/conference_spec.rb' - - 'spec/features/registration_periods_spec.rb' - # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/MapToHash: @@ -602,6 +1395,13 @@ Style/MultilineBlockChain: Exclude: - 'app/controllers/admin/comments_controller.rb' +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +Style/MultilineIfModifier: + Exclude: + - 'app/models/cfp.rb' + - 'app/models/registration_period.rb' + # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. @@ -610,22 +1410,52 @@ Style/MutableConstant: Exclude: - 'app/models/event_user.rb' -# Offense count: 32 +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods. +# AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with +Style/NestedParenthesizedCalls: + Exclude: + - 'spec/features/conference_spec.rb' + - 'spec/models/conference_spec.rb' + +# Offense count: 27 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MinBodyLength, AllowConsecutiveConditionals. +# SupportedStyles: skip_modifier_ifs, always +Style/Next: + Enabled: false + +# Offense count: 115 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedOctalStyle. +# SupportedOctalStyles: zero_with_o, zero_only +Style/NumericLiteralPrefix: + Exclude: + - 'spec/controllers/admin/conferences_controller_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. +Style/NumericLiterals: + MinDigits: 15 + +# Offense count: 27 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: - - 'app/controllers/admin/conferences_controller.rb' - 'app/helpers/application_helper.rb' - 'app/helpers/date_time_helper.rb' + - 'app/helpers/format_helper.rb' + - 'app/lib/rails_version.rb' - 'app/models/cfp.rb' - 'app/models/conference.rb' - 'app/models/event.rb' - 'app/models/program.rb' - 'app/models/registration.rb' - 'app/models/ticket_purchase.rb' - - 'app/models/user.rb' # Offense count: 3 Style/OptionalArguments: @@ -641,13 +1471,64 @@ Style/OptionalBooleanParameter: - 'app/helpers/format_helper.rb' - 'app/models/event.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/OrAssignment: + Exclude: + - 'app/controllers/schedules_controller.rb' + # Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. +Style/ParenthesesAroundCondition: + Exclude: + - 'app/controllers/admin/base_controller.rb' + - 'app/controllers/application_controller.rb' + +# Offense count: 17 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'app/models/conference.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: short, verbose +Style/PreferredHashMethods: + Exclude: + - 'lib/tasks/migrate_config.rake' + +# Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedCompactTypes. # SupportedStyles: compact, exploded Style/RaiseArgs: EnforcedStyle: compact +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RandomWithOffset: + Exclude: + - 'spec/factories/sponsors.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantAssignment: + Exclude: + - 'app/helpers/application_helper.rb' + - 'app/helpers/format_helper.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods. +# AllowedMethods: nonzero? +Style/RedundantCondition: + Exclude: + - 'app/helpers/versions_helper.rb' + - 'app/models/ticket.rb' + # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). Style/RedundantConstantBase: @@ -662,19 +1543,116 @@ Style/RedundantFetchBlock: Exclude: - 'config/puma.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/RedundantInterpolation: + Exclude: + - 'app/models/program.rb' + +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantParentheses: + Exclude: + - 'app/controllers/admin/base_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/models/admin_ability.rb' + - 'app/models/conference.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantParentheses: + Exclude: + - 'app/models/conference.rb' + # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). Style/RedundantStringEscape: Exclude: - 'app/models/conference.rb' -# Offense count: 34 +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'app/uploaders/picture_uploader.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'app/controllers/users/omniauth_callbacks_controller.rb' + - 'lib/tasks/migrate_config.rake' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: only_raise, only_fail, semantic +Style/SignalException: + Exclude: + - 'lib/tasks/user.rake' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowModifier. +Style/SoleNestedConditional: + Exclude: + - 'app/controllers/admin/users_controller.rb' + - 'app/models/event.rb' + - 'app/models/user.rb' + - 'db/migrate/20140801164901_move_conference_media_to_commercial.rb' + - 'db/migrate/20140801170430_move_event_media_to_commercial.rb' + - 'db/migrate/20151018152439_create_programs_table.rb' + +# Offense count: 20 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: + Exclude: + - 'app/controllers/admin/commercials_controller.rb' + - 'app/controllers/admin/conferences_controller.rb' + - 'app/controllers/admin/events_controller.rb' + - 'app/controllers/admin/roles_controller.rb' + - 'app/controllers/admin/surveys_controller.rb' + - 'app/controllers/payments_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/users_helper.rb' + - 'app/helpers/versions_helper.rb' + - 'app/models/conference.rb' + - 'features/step_definitions/conference_steps.rb' + - 'spec/features/contact_spec.rb' + - 'spec/helpers/events_helper_spec.rb' + - 'spec/mailers/mailbot_spec.rb' + - 'spec/services/mailbluster_manager_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/SuperArguments: + Exclude: + - 'app/models/event.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiteralsInInterpolation: + Exclude: + - 'app/views/admin/events/_all_events.xlsx.axlsx' + - 'app/views/admin/events/_all_with_comments.xlsx.axlsx' + - 'app/views/admin/events/_confirmed_events.xlsx.axlsx' + +# Offense count: 105 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: Enabled: false -# Offense count: 11 +# Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. # AllowedMethods: define_method, mail, respond_to @@ -685,19 +1663,35 @@ Style/SymbolProc: - 'app/models/ability.rb' - 'app/models/admin_ability.rb' - 'spec/controllers/admin/conferences_controller_spec.rb' - - 'spec/support/flash.rb' -# Offense count: 1 +# Offense count: 284 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowSafeAssignment. +# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex +Style/TernaryParentheses: + Exclude: + - 'app/helpers/format_helper.rb' + +# Offense count: 21 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' + - 'spec/models/conference_spec.rb' + +# Offense count: 10 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: WordRegex. # SupportedStyles: percent, brackets Style/WordArray: EnforcedStyle: percent - MinSize: 5 + MinSize: 6 -# Offense count: 269 +# Offense count: 430 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings. # URISchemes: http, https Layout/LineLength: Max: 267 diff --git a/.ruby-version b/.ruby-version index 37d02a6e3..4f5e69734 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.8 +3.4.5 diff --git a/.tool-versions b/.tool-versions index c47fe8b0d..d77f783f8 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -ruby 3.3.8 +ruby 3.4.5 nodejs 16.20.2 diff --git a/CHANGES.md b/CHANGES.md index 0080f6214..6da2b7496 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,18 +41,6 @@ data. bundle exec rake data:set_conference_in_versions RAILS_ENV=production ``` -### Organization admins - -We have a new role `organization admins` which allow a user to manage their -organization and create and manage a conference within the organization. This -needs the role to exist in the database, otherwise the application crashes -as it is assumed to exist. For that, run the following rake task: - -``` -bundle exec rake roles:add RAILS_ENV=production -``` - - # Changes in OSEM 1.0 [Released May 24, 2016](https://osem.io/1.0) diff --git a/Dockerfile b/Dockerfile index bd87877c8..f6953d55a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM registry.opensuse.org/opensuse/infrastructure/dale/containers/osem/base:latest -ARG CONTAINER_USERID +ARG CONTAINER_USERID=1000 # Configure our user RUN usermod -u $CONTAINER_USERID osem @@ -8,15 +8,16 @@ RUN usermod -u $CONTAINER_USERID osem # changes and all the subsequent stages (a.k.a. the bundle install call below) # have to be rebuild. Otherwise, after the first build of this image, # docker would use it's cache for this and the following stages. -COPY Gemfile /osem/ -COPY Gemfile.lock /osem/ +ADD Gemfile /osem/Gemfile +ADD Gemfile.lock /osem/Gemfile.lock RUN chown -R osem /osem -# Continue as user +WORKDIR /osem USER osem -WORKDIR /osem/ -# Install our bundle -RUN bundle install --jobs=3 --retry=3 +# Install our bundle & process manager +RUN bundle install --jobs=3 --retry=3; \ + gem install foreman +# Run our command CMD ["foreman", "start"] diff --git a/Gemfile b/Gemfile index 48f67f96f..9a10baca7 100644 --- a/Gemfile +++ b/Gemfile @@ -10,9 +10,9 @@ ruby file: '.tool-versions' # as web framework if next? - gem 'rails', '~> 7' + gem 'rails', '~> 8.0' else - gem 'rails', '~> 7.0' + gem 'rails', '~> 7.2' end # Use Puma as the app server @@ -22,7 +22,7 @@ gem 'puma' # http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#responders gem 'responders', '~> 3.0' -# as supported databases +# as database gem 'pg' # for tracking data changes @@ -86,14 +86,11 @@ gem 'cocoon' # as the JavaScript library # TODO: Consolidate with the rails-assets below or move to webpack... gem 'jquery-rails' -gem 'jquery-ui-rails', '~> 7.0.0' +gem 'jquery-ui-rails' # for languages validation gem 'iso-639' -# as date picker -gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' - # data tables gem 'ajax-datatables-rails' gem 'jquery-datatables' @@ -232,9 +229,7 @@ group :test do gem 'cucumber-rails', require: false gem 'cucumber-rails-training-wheels' # basic imperative step defs like "Then I should see..." gem 'database_cleaner' - gem 'geckodriver-helper' gem 'rspec-rails' - gem 'webdrivers' # for measuring test coverage gem 'simplecov' gem 'simplecov-cobertura' @@ -259,20 +254,17 @@ group :test do end group :development, :test, :linters do - # as debugger - gem 'byebug' - # for static code analisys gem 'rubocop', require: false gem 'rubocop-rspec', require: false gem 'rubocop-rails', require: false + gem 'rubocop-rspec_rails', require: false + gem 'rubocop-factory_bot', require: false gem 'rubocop-capybara', require: false gem 'rubocop-performance', require: false gem 'haml_lint' - + # TODO-SNAPCON: Why is this in the current group? gem 'faraday-retry', require: false - # TODO-SNAPCON: figure out which haml-lint OR haml_lint is good. - gem 'haml-lint', require: false # Easily run linters gem 'pronto', require: false @@ -281,8 +273,11 @@ group :development, :test, :linters do end group :development, :test do - # as development/test database - gem 'sqlite3' + # as capybara driver + gem 'webdrivers' + gem 'geckodriver-helper' + # as debugger + gem 'byebug' # to test new rails version gem 'next_rails' end diff --git a/Gemfile.lock b/Gemfile.lock index e8e00fba4..ff28376a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,116 +10,113 @@ GIT GEM remote: https://rubygems.org/ specs: - Ascii85 (1.1.0) - actioncable (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) + Ascii85 (2.0.1) + actioncable (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.4) - actionpack (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activesupport (= 7.0.8.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.4) - actionview (= 7.0.8.4) - activesupport (= 7.0.8.4) - rack (~> 2.0, >= 2.2.4) + zeitwerk (~> 2.6) + actionmailbox (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + actionmailer (7.2.2.1) + actionpack (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.4) - actionpack (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.2.1) + actionpack (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.4) - activesupport (= 7.0.8.4) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.14) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + active_model_serializers (0.10.15) actionpack (>= 4.1) activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.8.4) - activesupport (= 7.0.8.4) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.3.6) - activemodel (7.0.8.4) - activesupport (= 7.0.8.4) - activerecord (7.0.8.4) - activemodel (= 7.0.8.4) - activesupport (= 7.0.8.4) - activestorage (7.0.8.4) - actionpack (= 7.0.8.4) - activejob (= 7.0.8.4) - activerecord (= 7.0.8.4) - activesupport (= 7.0.8.4) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) + timeout (>= 0.4.0) + activestorage (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activesupport (= 7.2.2.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.4) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - acts_as_commentable_with_threading (2.0.1) - activerecord (>= 4.0) - activesupport (>= 4.0) - awesome_nested_set (>= 3.0) - acts_as_list (1.1.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + acts_as_commentable_with_threading (1.2.0) + activerecord (>= 3.0) + activesupport (>= 3.0) + awesome_nested_set (>= 2.0) + acts_as_list (1.0.4) activerecord (>= 4.2) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - afm (0.2.2) - ajax-datatables-rails (1.4.0) - rails (>= 5.2) + afm (1.0.0) + ajax-datatables-rails (1.3.1) zeitwerk - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) - archive-zip (0.12.0) - io-like (~> 0.3.0) - ast (2.4.2) - autoprefixer-rails (10.4.16.0) + archive-zip (0.13.1) + io-like (~> 0.4.0) + ast (2.4.3) + autoprefixer-rails (10.3.1.0) execjs (~> 2) - awesome_nested_set (3.6.0) - activerecord (>= 4.0.0, < 7.2) - aws_cf_signer (0.1.3) + awesome_nested_set (3.8.0) + activerecord (>= 4.0.0, < 8.1) base64 (0.3.0) bcrypt (3.1.20) - bigdecimal (3.1.6) + benchmark (0.4.1) + bigdecimal (3.2.2) bindex (0.8.1) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) bootstrap-switch-rails (3.3.3) - bootstrap3-datetimepicker-rails (4.17.47) - momentjs-rails (>= 2.8.1) builder (3.3.0) - bullet (7.0.2) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.11) - byebug (11.1.3) - cancancan (3.5.0) + byebug (12.0.0) + cancancan (3.3.0) capybara (3.40.0) addressable matrix @@ -129,9 +126,9 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.6) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) + carrierwave (3.1.2) + activemodel (>= 6.0.0) + activesupport (>= 6.0.0) addressable (~> 2.6) image_processing (~> 1.1) marcel (~> 1.0.0) @@ -143,86 +140,50 @@ GEM fastimage case_transform (0.2) activesupport - caxlsx (3.4.1) + caxlsx (4.3.0) htmlentities (~> 4.3, >= 4.3.4) marcel (~> 1.0) nokogiri (~> 1.10, >= 1.10.4) - rubyzip (>= 1.3.0, < 3) - caxlsx_rails (0.6.3) + rubyzip (>= 2.4, < 4) + caxlsx_rails (0.6.2) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (5.0.6) + chartkick (5.2.0) + childprocess (5.1.0) + logger (~> 1.5) chronic (0.10.2) chunky_png (1.4.0) - climate_control (1.2.0) - cloudinary (1.29.0) - aws_cf_signer - rest-client (>= 2.0.0) + climate_control (1.0.1) + cloudinary (2.3.1) + faraday (>= 2.0.1, < 3.0.0) + faraday-follow_redirects (~> 0.3.0) + faraday-multipart (~> 1.0, >= 1.0.4) + ostruct cocoon (1.2.15) - colorize (1.1.0) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) countable-rails (0.0.1) railties (>= 3.1) - crack (1.0.0) - bigdecimal + crack (0.4.5) rexml crass (1.0.6) - cucumber (7.1.0) - builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-create-meta (~> 6.0, >= 6.0.1) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-html-formatter (~> 17.0, >= 17.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-wire (~> 6.2, >= 6.2.0) - diff-lcs (~> 1.4, >= 1.4.4) - mime-types (~> 3.3, >= 3.3.1) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-core (10.1.1) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-create-meta (6.0.4) - cucumber-messages (~> 17.1, >= 17.1.1) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-cucumber-expressions (14.0.0) - cucumber-gherkin (22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-html-formatter (17.0.0) - cucumber-messages (~> 17.1, >= 17.1.0) - cucumber-messages (17.1.1) - cucumber-rails (2.6.1) - capybara (>= 2.18, < 4) - cucumber (>= 3.2, < 9) - mime-types (~> 3.3) - nokogiri (~> 1.10) - railties (>= 5.0, < 8) - rexml (~> 3.0) - webrick (~> 1.7) - cucumber-rails-training-wheels (1.0.0) - cucumber-rails (>= 1.1.1) - cucumber-tag-expressions (4.1.0) - cucumber-wire (6.2.1) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - daemons (1.4.1) - dalli (3.2.8) + csv (3.3.5) + daemons (1.4.0) + dalli (2.7.11) dante (0.2.0) - database_cleaner (2.0.2) + database_cleaner (2.1.0) database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - date (3.3.4) - delayed_job (4.1.11) - activesupport (>= 3.0, < 8.0) - delayed_job_active_record (4.1.8) - activerecord (>= 3.0, < 8.0) + date (3.4.1) + delayed_job (4.1.13) + activesupport (>= 3.0, < 9.0) + delayed_job_active_record (4.1.11) + activerecord (>= 3.0, < 9.0) delayed_job (>= 3.0, < 5) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -230,34 +191,39 @@ GEM warden (~> 1.2.3) devise_ichain_authenticatable (0.3.2) devise (>= 2.2) - diff-lcs (1.5.1) - docile (1.4.0) - domain_name (0.6.20240107) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) - erubi (1.13.0) - execjs (2.9.1) - factory_bot (6.4.6) - activesupport (>= 5.0.0) - factory_bot_rails (6.4.3) - factory_bot (~> 6.4) - railties (>= 5.0.0) - faker (3.2.3) + diff-lcs (1.6.2) + docile (1.4.1) + dotenv (3.1.8) + dotenv-rails (3.1.8) + dotenv (= 3.1.8) + railties (>= 6.1) + drb (2.2.3) + erb (5.0.2) + erubi (1.13.1) + execjs (2.8.1) + factory_bot (6.5.4) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.0) + factory_bot (~> 6.5) + railties (>= 6.1.0) + faker (3.5.2) i18n (>= 1.8.11, < 2) - faraday (2.9.0) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) - net-http + faraday (2.13.4) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-multipart (1.1.1) + multipart-post (~> 2.0) + faraday-net_http (3.4.1) + net-http (>= 0.5.0) faraday-retry (2.2.0) faraday (~> 2.0) - fastimage (2.3.0) + fastimage (2.4.0) feature (1.4.0) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) - font-awesome-sass (6.5.1) + ffi (1.17.2) + font-awesome-sass (6.7.2) sassc (~> 2.0) geckodriver-helper (0.24.0) archive-zip (~> 0.7) @@ -267,76 +233,89 @@ GEM globalid (1.2.1) activesupport (>= 6.1) gravtastic (3.2.6) - haml (6.1.1) + haml (6.3.0) temple (>= 0.8.2) thor tilt - haml-lint (0.999.999) - haml_lint haml-rails (2.1.0) actionpack (>= 5.1) activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) - haml_lint (0.45.0) - haml (>= 4.0, < 6.2) + haml_lint (0.66.0) + haml (>= 5.0) parallel (~> 1.10) rainbow - rubocop (>= 0.50.0) + rubocop (>= 1.0) sysexits (~> 1.1) - hashdiff (1.1.0) + hashdiff (1.0.1) hashery (2.1.2) hashie (5.0.0) htmlentities (4.3.4) - http-accept (1.7.0) - http-cookie (1.0.5) - domain_name (~> 0.5) httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.14.5) + i18n (1.14.7) concurrent-ruby (~> 1.0) - i18n_data (0.17.1) - simple_po_parser (~> 1.1) - icalendar (2.10.1) + i18n_data (0.13.0) + icalendar (2.11.2) + base64 ice_cube (~> 0.16) - ice_cube (0.16.4) - image_processing (1.13.0) - mini_magick (>= 4.9.5, < 5) + logger + ostruct + ice_cube (0.17.0) + image_processing (1.14.0) + mini_magick (>= 4.9.5, < 6) ruby-vips (>= 2.0.17, < 3) - io-like (0.3.1) - iso-639 (0.3.6) - jquery-datatables (1.10.20) - jquery-rails (4.6.0) + io-console (0.8.1) + io-like (0.4.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + iso-639 (0.3.8) + csv + jquery-datatables-rails (3.4.0) + actionpack (>= 3.1) + jquery-rails + railties (>= 3.1) + sass-rails + jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (7.0.0) railties (>= 3.2.16) - json (2.7.1) - json-schema (4.1.1) - addressable (>= 2.8) + json (2.13.2) + json-schema (6.0.0) + addressable (~> 2.8) + bigdecimal (~> 3.1) jsonapi-renderer (0.2.2) - jwt (2.7.1) - language_server-protocol (3.17.0.3) - launchy (2.5.2) + jwt (3.1.2) + base64 + language_server-protocol (3.17.0.5) + launchy (3.1.1) addressable (~> 2.8) - leaflet-rails (1.9.3) - rails (>= 4.2.0) - letter_opener (1.9.0) - launchy (>= 2.2, < 3) - letter_opener_web (2.0.0) - actionmailer (>= 5.2) - letter_opener (~> 1.7) - railties (>= 5.2) + childprocess (~> 5.0) + logger (~> 1.6) + leaflet-rails (1.9.5) + actionpack (>= 4.2.0) + railties (>= 4.2.0) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) + letter_opener_web (3.0.0) + actionmailer (>= 6.1) + letter_opener (~> 1.9) + railties (>= 6.1) rexml - logger (1.6.0) + lint_roller (1.1.0) + logger (1.7.0) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.22.0) + loofah (2.24.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -345,257 +324,261 @@ GEM net-pop net-smtp marcel (1.0.4) - matrix (0.4.2) - method_source (1.0.0) - mime-types (3.5.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2024.0206) - mina (1.2.5) + matrix (0.4.3) + mina (1.2.4) + open4 (~> 1.3.4) rake - mini_magick (4.13.2) + mini_magick (5.3.1) + logger mini_mime (1.1.5) - minitest (5.24.1) - momentjs-rails (2.29.4.1) - railties (>= 3.1) - monetize (1.13.0) + mini_portile2 (2.8.9) + minitest (5.25.5) + monetize (1.9.4) money (~> 6.12) - money (6.18.0) + money (6.13.8) i18n (>= 0.6.4, <= 2) - money-rails (1.15.0) + money-rails (1.14.0) activesupport (>= 3.0) - monetize (~> 1.9) - money (~> 6.13) + monetize (~> 1.9.0) + money (~> 6.13.2) railties (>= 3.0) - multi_json (1.15.0) - multi_test (0.1.2) - multi_xml (0.6.0) - net-http (0.4.1) + multi_json (1.17.0) + multi_xml (0.7.2) + bigdecimal (~> 3.1) + multipart-post (2.4.1) + net-http (0.6.0) uri - net-imap (0.4.10) + net-imap (0.5.9) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.1) net-protocol - netrc (0.11.0) - next_rails (1.3.0) - colorize (>= 0.8.1) - nio4r (2.7.0) - nokogiri (1.16.6-arm64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-linux) + next_rails (1.4.6) + rainbow (>= 3) + nio4r (2.7.4) + nokogiri (1.18.9) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - oauth2 (2.0.9) - faraday (>= 0.17.3, < 3.0) - jwt (>= 1.0, < 3.0) + oauth2 (2.0.12) + faraday (>= 0.17.3, < 4.0) + jwt (>= 1.0, < 4.0) + logger (~> 1.2) multi_xml (~> 0.5) rack (>= 1.2, < 4) - snaky_hash (~> 2.0) - version_gem (~> 1.1) - octokit (6.1.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - omniauth (2.1.1) + snaky_hash (~> 2.0, >= 2.0.3) + version_gem (>= 1.1.8, < 3) + omniauth (2.1.3) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection - omniauth-facebook (9.0.0) + omniauth-facebook (8.0.0) omniauth-oauth2 (~> 1.2) omniauth-github (2.0.1) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-google-oauth2 (1.1.1) - jwt (>= 2.0) - oauth2 (~> 2.0.6) + omniauth-google-oauth2 (1.2.1) + jwt (>= 2.9.2) + oauth2 (~> 2.0) omniauth (~> 2.0) - omniauth-oauth2 (~> 1.8.0) + omniauth-oauth2 (~> 1.8) omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) - omniauth-openid (2.0.1) - omniauth (>= 1.0, < 3.0) - rack-openid (~> 1.4.0) - omniauth-rails_csrf_protection (1.0.1) + omniauth-openid (2.0.2) + omniauth (>= 1.1) + rack-openid (~> 1.4) + ruby-openid (~> 2.1, >= 2.1.8) + version_gem (~> 1.1, >= 1.1.8) + omniauth-rails_csrf_protection (1.0.0) actionpack (>= 4.2) omniauth (~> 2.0) + open4 (1.3.4) orm_adapter (0.5.0) - pagy (3.11.0) - paper_trail (12.3.0) - activerecord (>= 5.2) - request_store (~> 1.1) - parallel (1.24.0) - parser (3.3.0.5) + ostruct (0.6.3) + paper_trail (16.0.0) + activerecord (>= 6.1) + request_store (~> 1.4) + parallel (1.27.0) + parser (3.3.9.0) ast (~> 2.4.1) racc - pdf-core (0.9.0) + pdf-core (0.10.0) pdf-inspector (1.3.0) pdf-reader (>= 1.0, < 3.0.a) - pdf-reader (2.12.0) - Ascii85 (~> 1.0) - afm (~> 0.2.1) + pdf-reader (2.15.0) + Ascii85 (>= 1.0, < 3.0, != 2.0.0) + afm (>= 0.2.1, < 2) hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.6) - prawn (2.4.0) - pdf-core (~> 0.9.0) - ttfunk (~> 1.7) + pg (1.6.1) + pp (0.6.2) + prettyprint + prawn (2.5.0) + matrix (~> 0.4) + pdf-core (~> 0.10.0) + ttfunk (~> 1.8) prawn-qrcode (0.5.2) prawn (>= 1) rqrcode (>= 1.0.0) - prawn-rails (1.4.2) + prawn-rails (1.6.0) actionview (>= 3.1.0) + activesupport (>= 3.1.0) prawn prawn-table prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - pronto (0.11.1) - gitlab (>= 4.4.0, < 5.0) - httparty (>= 0.13.7, < 1.0) - octokit (>= 4.7.0, < 7.0) - rainbow (>= 2.2, < 4.0) - rexml (>= 3.2.5, < 4.0) - rugged (>= 0.23.0, < 2.0) - thor (>= 0.20.3, < 2.0) - pronto-haml (0.11.1) - haml_lint (~> 0.23) - pronto (~> 0.11.0) - pronto-rubocop (0.11.2) - pronto (~> 0.11.0) - rubocop (>= 0.63.1, < 2.0) - public_suffix (6.0.1) - puma (6.4.2) + prettyprint (0.2.0) + prism (1.4.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) + puma (6.6.1) nio4r (~> 2.0) - racc (1.8.0) - rack (2.2.9) + racc (1.8.1) + rack (3.1.16) rack-openid (1.4.2) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-protection (3.0.6) - rack - rack-test (2.1.0) + rack-protection (4.1.1) + base64 (>= 0.1.0) + logger (>= 1.6.0) + rack (>= 3.0.0, < 4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8.4) - actioncable (= 7.0.8.4) - actionmailbox (= 7.0.8.4) - actionmailer (= 7.0.8.4) - actionpack (= 7.0.8.4) - actiontext (= 7.0.8.4) - actionview (= 7.0.8.4) - activejob (= 7.0.8.4) - activemodel (= 7.0.8.4) - activerecord (= 7.0.8.4) - activestorage (= 7.0.8.4) - activesupport (= 7.0.8.4) + rackup (2.2.1) + rack (>= 3) + rails (7.2.2.1) + actioncable (= 7.2.2.1) + actionmailbox (= 7.2.2.1) + actionmailer (= 7.2.2.1) + actionpack (= 7.2.2.1) + actiontext (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activemodel (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) bundler (>= 1.15.0) - railties (= 7.0.8.4) + railties (= 7.2.2.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.2.0) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.8) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.1) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8.4) - actionpack (= 7.0.8.4) - activesupport (= 7.0.8.4) - method_source + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) - recaptcha (5.16.0) - redcarpet (3.6.0) - redis (4.7.1) - regexp_parser (2.9.0) - request_store (1.6.0) + rake (13.3.0) + rdoc (6.14.2) + erb + psych (>= 4.0.0) + recaptcha (5.20.1) + redcarpet (3.6.1) + regexp_parser (2.11.2) + reline (0.6.2) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - rexml (3.3.6) - strscan - rolify (6.0.1) - rqrcode (2.2.0) + rexml (3.4.1) + rolify (6.0.0) + rqrcode (3.1.0) chunky_png (~> 1.0) - rqrcode_core (~> 1.0) - rqrcode_core (1.2.0) - rspec-activemodel-mocks (1.2.0) + rqrcode_core (~> 2.0) + rqrcode_core (2.0.0) + rspec-activemodel-mocks (1.3.0) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.13.0) + rspec-core (3.13.5) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.13.1) - rubocop (1.61.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.4) + rubocop (1.79.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.46.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.1) - parser (>= 3.3.0.4) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-performance (1.20.2) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.19.1) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.46.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-capybara (2.22.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-factory_bot (2.27.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-performance (1.25.0) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails (2.33.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.23.0) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - ruby-oembed (0.17.0) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.6.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-rspec_rails (2.31.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-rspec (~> 3.5) + ruby-oembed (0.15.0) ruby-openid (2.9.2) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) - ruby-vips (2.2.2) + ruby-vips (2.2.5) ffi (~> 1.12) logger - rubyzip (2.3.2) - rugged (1.5.1) + rubyzip (2.4.1) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -606,65 +589,56 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) + securerandom (0.4.1) selectize-rails (0.12.6) selenium-webdriver (4.10.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-delayed_job (5.16.1) - delayed_job (>= 4.0) - sentry-ruby (~> 5.16.1) - sentry-rails (5.16.1) + sentry-rails (5.26.0) railties (>= 5.0) - sentry-ruby (~> 5.16.1) - sentry-ruby (5.16.1) + sentry-ruby (~> 5.26.0) + sentry-ruby (5.26.0) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - shoulda-matchers (6.1.0) + shoulda-matchers (6.5.0) activesupport (>= 5.2.0) - simple_po_parser (1.1.6) - simplecov (0.19.0) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.0.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - snaky_hash (2.0.1) - hashie - version_gem (~> 1.1, >= 1.1.1) - sprockets (4.2.1) + snaky_hash (2.0.3) + hashie (>= 0.1.0, < 6) + version_gem (>= 1.1.8, < 3) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.7.2-arm64-darwin) - sqlite3 (1.7.2-x86_64-darwin) - sqlite3 (1.7.2-x86_64-linux) - ssrf_filter (1.1.2) - stripe (5.55.0) - stripe-ruby-mock (3.1.0) + ssrf_filter (1.3.0) + stringio (3.1.7) + stripe (5.43.0) + stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) - strscan (3.1.0) - sys-uname (1.2.2) + sys-uname (1.3.1) ffi (~> 1.1) sysexits (1.2.0) - temple (0.10.3) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.3.1) - tilt (2.1.0) - timecop (0.9.8) - timeout (0.4.1) - transitions (1.3.0) + temple (0.10.4) + thor (1.4.0) + tilt (2.6.1) + timecop (0.9.4) + timeout (0.4.3) + transitions (1.2.1) ttfunk (1.8.0) bigdecimal (~> 3.1) turbolinks (5.2.1) @@ -674,15 +648,18 @@ GEM concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.5.0) + unicode-display_width (3.1.5) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) uniform_notifier (1.16.0) unobtrusive_flash (3.3.1) railties - uri (0.13.0) - version_gem (1.1.3) + uri (1.0.3) + useragent (0.16.11) + version_gem (1.1.8) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.1) + web-console (4.1.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) @@ -691,20 +668,20 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - webmock (3.23.0) + webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.1) - websocket (1.2.9) - websocket-driver (0.7.6) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.13) + zeitwerk (2.7.3) PLATFORMS arm64-darwin-20 @@ -725,7 +702,6 @@ DEPENDENCIES base64 bootstrap-sass (~> 3.4.0) bootstrap-switch-rails (= 3.3.3) - bootstrap3-datetimepicker-rails (~> 4.17.47) bullet byebug cancancan @@ -754,7 +730,6 @@ DEPENDENCIES font-awesome-sass geckodriver-helper gravtastic - haml-lint haml-rails haml_lint httparty @@ -763,7 +738,7 @@ DEPENDENCIES iso-639 jquery-datatables jquery-rails - jquery-ui-rails (~> 7.0.0) + jquery-ui-rails json-schema leaflet-rails letter_opener @@ -791,7 +766,7 @@ DEPENDENCIES pronto-haml pronto-rubocop puma - rails (~> 7.0) + rails (~> 7.2) rails-controller-testing rails-i18n recaptcha @@ -805,9 +780,11 @@ DEPENDENCIES rspec-rails rubocop rubocop-capybara + rubocop-factory_bot rubocop-performance rubocop-rails rubocop-rspec + rubocop-rspec_rails ruby-oembed sass-rails (>= 4.0.2) selectize-rails @@ -818,7 +795,6 @@ DEPENDENCIES simplecov simplecov-cobertura sprockets-rails - sqlite3 stripe stripe-ruby-mock (~> 3.1.0.rc3) timecop @@ -832,7 +808,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 3.3.8p144 + ruby 3.4.5 BUNDLED WITH - 2.5.6 + 2.6.9 diff --git a/Gemfile.next.lock b/Gemfile.next.lock index cdb7ec0a4..902e1ee75 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -1,118 +1,91 @@ -GIT - remote: https://github.com/snap-cloud/omniauth-discourse.git - revision: 96dbfcb55bf7bef5a33f83a4919879c891af367c - specs: - omniauth-discourse (1.1.0) - addressable (~> 2.7) - omniauth (~> 2.0) - rack - -GEM - remote: https://rails-assets.org/ - specs: - rails-assets-bootstrap (3.4.1) - rails-assets-jquery (>= 1.9.1, < 4) - rails-assets-bootstrap-markdown (2.10.0) - rails-assets-bootstrap (~> 3) - rails-assets-bootstrap-select (1.13.10) - rails-assets-bootstrap (>= 3.0.0) - rails-assets-jquery (>= 1.9.1, < 4) - rails-assets-date.format (1.2.3) - rails-assets-holderjs (2.9.6) - rails-assets-jquery (3.4.1) - rails-assets-jquery-smooth-scroll (2.2.0) - rails-assets-jquery (>= 1.7.0) - rails-assets-markdown (0.5.0) - rails-assets-momentjs (2.22.2) - rails-assets-spectrum (1.8.0) - rails-assets-jquery (>= 1.7.2) - rails-assets-tinycolor (1.4.1) - rails-assets-to-markdown (3.1.1) - rails-assets-trianglify (1.2.0) - rails-assets-waypoints (4.0.1) - GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (7.0.1) - actionpack (= 7.0.1) - activesupport (= 7.0.1) + actioncable (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.1) - actionpack (= 7.0.1) - activejob (= 7.0.1) - activerecord (= 7.0.1) - activestorage (= 7.0.1) - activesupport (= 7.0.1) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.1) - actionpack (= 7.0.1) - actionview (= 7.0.1) - activejob (= 7.0.1) - activesupport (= 7.0.1) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.1) - actionview (= 7.0.1) - activesupport (= 7.0.1) - rack (~> 2.0, >= 2.2.0) + zeitwerk (~> 2.6) + actionmailbox (8.0.2) + actionpack (= 8.0.2) + activejob (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) + mail (>= 2.8.0) + actionmailer (8.0.2) + actionpack (= 8.0.2) + actionview (= 8.0.2) + activejob (= 8.0.2) + activesupport (= 8.0.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.2) + actionview (= 8.0.2) + activesupport (= 8.0.2) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.1) - actionpack (= 7.0.1) - activerecord (= 7.0.1) - activestorage (= 7.0.1) - activesupport (= 7.0.1) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.2) + actionpack (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.1) - activesupport (= 7.0.1) + actionview (8.0.2) + activesupport (= 8.0.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.13) - actionpack (>= 4.1, < 7.1) - activemodel (>= 4.1, < 7.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + active_model_serializers (0.10.15) + actionpack (>= 4.1) + activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.1) - activesupport (= 7.0.1) + activejob (8.0.2) + activesupport (= 8.0.2) globalid (>= 0.3.6) - activemodel (7.0.1) - activesupport (= 7.0.1) - activerecord (7.0.1) - activemodel (= 7.0.1) - activesupport (= 7.0.1) - activestorage (7.0.1) - actionpack (= 7.0.1) - activejob (= 7.0.1) - activerecord (= 7.0.1) - activesupport (= 7.0.1) + activemodel (8.0.2) + activesupport (= 8.0.2) + activerecord (8.0.2) + activemodel (= 8.0.2) + activesupport (= 8.0.2) + timeout (>= 0.4.0) + activestorage (8.0.2) + actionpack (= 8.0.2) + activejob (= 8.0.2) + activerecord (= 8.0.2) + activesupport (= 8.0.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.1) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) acts_as_commentable_with_threading (1.2.0) activerecord (>= 3.0) activesupport (>= 3.0) awesome_nested_set (>= 2.0) acts_as_list (1.0.4) activerecord (>= 4.2) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) afm (0.2.2) ajax-datatables-rails (1.3.1) zeitwerk @@ -121,30 +94,29 @@ GEM rake (>= 10.4, < 14.0) archive-zip (0.12.0) io-like (~> 0.3.0) - ast (2.4.2) + ast (2.4.3) autoprefixer-rails (10.3.1.0) execjs (~> 2) - awesome_nested_set (3.5.0) - activerecord (>= 4.0.0, < 7.1) + awesome_nested_set (3.8.0) + activerecord (>= 4.0.0, < 8.1) aws_cf_signer (0.1.3) - bcrypt (3.1.16) + base64 (0.3.0) + bcrypt (3.1.20) + benchmark (0.4.1) + bigdecimal (3.2.2) bindex (0.8.1) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) bootstrap-switch-rails (3.3.3) - bootstrap3-datetimepicker-rails (4.17.47) - momentjs-rails (>= 2.8.1) - builder (3.2.4) - bullet (7.0.7) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.11) + builder (3.3.0) byebug (11.1.3) cancancan (3.3.0) - capybara (3.35.3) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -172,7 +144,8 @@ GEM actionpack (>= 3.1) caxlsx (>= 3.0) chartkick (4.1.3) - childprocess (3.0.0) + childprocess (5.1.0) + logger (~> 1.5) chronic (0.10.2) chunky_png (1.4.0) climate_control (1.0.1) @@ -182,16 +155,10 @@ GEM cocoon (1.2.15) coderay (1.1.3) colorize (0.8.1) - concurrent-ruby (1.1.9) - connection_pool (2.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) countable-rails (0.0.1) railties (>= 3.1) - countries (4.0.1) - i18n_data (~> 0.13.0) - sixarm_ruby_unaccent (~> 1.1) - country_select (6.0.0) - countries (~> 4.0) - sort_alphabetical (~> 1.1) crack (0.4.5) rexml crass (1.0.6) @@ -238,18 +205,19 @@ GEM daemons (1.4.0) dalli (2.7.11) dante (0.2.0) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - delayed_job (4.1.10) - activesupport (>= 3.0, < 8.0) - delayed_job_active_record (4.1.7) - activerecord (>= 3.0, < 8.0) + date (3.4.1) + delayed_job (4.1.13) + activesupport (>= 3.0, < 9.0) + delayed_job_active_record (4.1.11) + activerecord (>= 3.0, < 9.0) delayed_job (>= 3.0, < 5) - devise (4.8.1) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -257,8 +225,7 @@ GEM warden (~> 1.2.3) devise_ichain_authenticatable (0.3.2) devise (>= 2.2) - diff-lcs (1.4.4) - digest (3.1.0) + diff-lcs (1.6.2) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -266,7 +233,9 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) - erubi (1.10.0) + drb (2.2.3) + erb (5.0.2) + erubi (1.13.1) erubis (2.7.0) execjs (2.8.1) factory_bot (6.2.0) @@ -298,21 +267,12 @@ GEM fastimage (2.2.5) feature (1.4.0) ffi (1.15.3) - flay (2.13.0) - erubi (~> 1.10) - path_expander (~> 1.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) - font-awesome-sass (6.3.0) + font-awesome-sass (6.7.2) sassc (~> 2.0) - formatador (1.1.0) geckodriver-helper (0.24.0) archive-zip (~> 0.7) - gitlab (4.19.0) - httparty (~> 0.20) - terminal-table (>= 1.5.1) - globalid (1.0.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) gravtastic (3.2.6) guard (2.18.0) formatador (>= 0.2.4) @@ -357,10 +317,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.4) domain_name (~> 0.5) - httparty (0.21.0) - mini_mime (>= 1.0.0) - multi_xml (>= 0.5.2) - i18n (1.9.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) i18n_data (0.13.0) icalendar (2.7.1) @@ -369,8 +326,12 @@ GEM image_processing (1.12.1) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) + io-console (0.8.1) io-like (0.3.1) - io-wait (0.2.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) iso-639 (0.3.5) jquery-datatables (1.10.20) jquery-rails (4.4.0) @@ -384,29 +345,38 @@ GEM addressable (>= 2.4) jsonapi-renderer (0.2.2) jwt (2.2.3) - launchy (2.5.0) - addressable (~> 2.7) - leaflet-rails (1.7.0) - rails (>= 4.2.0) - letter_opener (1.7.0) - launchy (~> 2.2) - letter_opener_web (2.0.0) - actionmailer (>= 5.2) - letter_opener (~> 1.7) - railties (>= 5.2) + language_server-protocol (3.17.0.5) + launchy (3.1.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (~> 1.6) + leaflet-rails (1.9.5) + actionpack (>= 4.2.0) + railties (>= 4.2.0) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) + letter_opener_web (3.0.0) + actionmailer (>= 6.1) + letter_opener (~> 1.9) + railties (>= 6.1) rexml - listen (3.8.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.13.0) + lint_roller (1.1.0) + logger (1.7.0) + lograge (0.14.0) + actionpack (>= 4) + activesupport (>= 4) + railties (>= 4) + request_store (~> 1.0) + loofah (2.24.1) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - lumberjack (1.2.8) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2021.0704) @@ -414,11 +384,9 @@ GEM open4 (~> 1.3.4) rake mini_magick (4.11.0) - mini_mime (1.1.2) - mini_portile2 (2.7.1) - minitest (5.15.0) - momentjs-rails (2.20.1) - railties (>= 3.1) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.25.5) monetize (1.9.4) money (~> 6.12) money (6.13.8) @@ -432,28 +400,21 @@ GEM multi_test (0.1.2) multi_xml (0.6.0) multipart-post (2.1.1) - nenv (0.3.0) - net-imap (0.2.3) - digest + net-imap (0.5.9) + date net-protocol - strscan - net-pop (0.1.1) - digest + net-pop (0.1.2) net-protocol + net-protocol (0.2.2) timeout - net-protocol (0.1.2) - io-wait - timeout - net-smtp (0.3.1) - digest + net-smtp (0.5.1) net-protocol - timeout netrc (0.11.0) next_rails (1.0.4) colorize (>= 0.8.1) - nio4r (2.5.8) - nokogiri (1.13.1) - mini_portile2 (~> 2.7.0) + nio4r (2.7.4) + nokogiri (1.18.9) + mini_portile2 (~> 2.8.2) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -492,14 +453,13 @@ GEM omniauth (~> 2.0) open4 (1.3.4) orm_adapter (0.5.0) - pagy (3.11.0) - paper_trail (12.2.0) - activerecord (>= 5.2) - request_store (~> 1.1) - parallel (1.21.0) - parser (3.1.0.0) + paper_trail (16.0.0) + activerecord (>= 6.1) + request_store (~> 1.4) + parallel (1.27.0) + parser (3.3.9.0) ast (~> 2.4.1) - path_expander (1.1.1) + racc pdf-core (0.9.0) pdf-inspector (1.3.0) pdf-reader (>= 1.0, < 3.0.a) @@ -509,7 +469,9 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.2.3) + pg (1.6.1) + pp (0.6.2) + prettyprint prawn (2.4.0) pdf-core (~> 0.9.0) ttfunk (~> 1.7) @@ -522,98 +484,86 @@ GEM prawn-table prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - pronto (0.11.1) - gitlab (>= 4.4.0, < 5.0) - httparty (>= 0.13.7, < 1.0) - octokit (>= 4.7.0, < 7.0) - rainbow (>= 2.2, < 4.0) - rexml (>= 3.2.5, < 4.0) - rugged (>= 0.23.0, < 2.0) - thor (>= 0.20.3, < 2.0) - pronto-flay (0.11.1) - flay (~> 2.8) - pronto (~> 0.11.0) - pronto-haml (0.11.1) - haml_lint (~> 0.23) - pronto (~> 0.11.0) - pronto-rubocop (0.11.5) - pronto (~> 0.11.0) - rubocop (>= 0.63.1, < 2.0) - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) - public_suffix (4.0.6) + prettyprint (0.2.0) + prism (1.4.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) puma (4.3.8) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.3) + racc (1.8.1) + rack (2.2.17) rack-openid (1.4.2) rack (>= 1.1.0) ruby-openid (>= 2.1.8) rack-protection (2.1.0) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (7.0.1) - actioncable (= 7.0.1) - actionmailbox (= 7.0.1) - actionmailer (= 7.0.1) - actionpack (= 7.0.1) - actiontext (= 7.0.1) - actionview (= 7.0.1) - activejob (= 7.0.1) - activemodel (= 7.0.1) - activerecord (= 7.0.1) - activestorage (= 7.0.1) - activesupport (= 7.0.1) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) + rack (>= 1.3) + rackup (1.0.1) + rack (< 3) + webrick + rails (8.0.2) + actioncable (= 8.0.2) + actionmailbox (= 8.0.2) + actionmailer (= 8.0.2) + actionpack (= 8.0.2) + actiontext (= 8.0.2) + actionview (= 8.0.2) + activejob (= 8.0.2) + activemodel (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) bundler (>= 1.15.0) - railties (= 7.0.1) + railties (= 8.0.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) - rails-i18n (7.0.1) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (8.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.0.1) - actionpack (= 7.0.1) - activesupport (= 7.0.1) - method_source + railties (>= 8.0.0, < 9) + railties (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - rb-fsevent (0.11.2) - rb-inotify (0.10.1) - ffi (~> 1.0) + rake (13.3.0) + rdoc (6.14.2) + erb + psych (>= 4.0.0) recaptcha (5.8.1) json redcarpet (3.5.1) - redis (5.0.6) - redis-client (>= 0.9.0) - redis-client (0.12.2) - connection_pool - regexp_parser (2.2.0) - request_store (1.5.1) + regexp_parser (2.11.1) + reline (0.6.2) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) + rexml (3.4.1) rolify (6.0.0) rqrcode (2.0.0) chunky_png (~> 1.0) @@ -627,55 +577,66 @@ GEM activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec-core (3.13.5) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.10.2) - rubocop (1.25.1) + rspec-support (~> 3.13.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.4) + rubocop (1.79.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.15.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.46.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.15.1) - parser (>= 3.0.1.1) - rubocop-faker (1.1.0) - faker (>= 2.12.0) - rubocop (>= 0.82.0) - rubocop-rails (2.15.2) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.46.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-capybara (2.22.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-factory_bot (2.27.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-performance (1.25.0) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails (2.11.3) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) rubocop-rspec (2.4.0) rubocop (~> 1.0) rubocop-ast (>= 1.1.0) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) ruby-oembed (0.15.0) ruby-openid (2.9.2) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) ruby-vips (2.1.2) ffi (~> 1.12) ruby2_keywords (0.0.5) ruby_parser (3.17.0) sexp_processor (~> 4.15, >= 4.15.1) - rubyzip (2.3.2) - rugged (1.5.1) + rubyzip (2.4.1) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -686,16 +647,12 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) + securerandom (0.4.1) selectize-rails (0.12.6) - selenium-webdriver (3.142.7) - childprocess (>= 0.5, < 4.0) - rubyzip (>= 1.2.2) - sentry-delayed_job (5.8.0) - delayed_job (>= 4.0) - sentry-ruby (~> 5.8.0) + selenium-webdriver (4.10.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) sentry-rails (4.6.5) railties (>= 5.0) sentry-ruby-core (~> 4.6.0) @@ -716,11 +673,6 @@ GEM simplecov (~> 0.8) simplecov-html (0.12.3) simplecov_json_formatter (0.1.3) - sixarm_ruby_unaccent (1.2.0) - skylight (5.3.3) - activesupport (>= 5.2.0) - sort_alphabetical (1.1.0) - unicode_utils (>= 1.2.2) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -728,41 +680,38 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.4.2) ssrf_filter (1.0.7) + stringio (3.1.7) stripe (5.43.0) stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) - strscan (3.0.1) - sys-uname (1.2.2) - ffi (~> 1.1) sysexits (1.2.0) temple (0.8.2) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.2.1) + thor (1.4.0) tilt (2.0.10) timecop (0.9.4) - timeout (0.2.0) + timeout (0.4.3) transitions (1.2.1) ttfunk (1.7.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.7.7) - unicode-display_width (2.1.0) - unicode_utils (1.4.0) - uniform_notifier (1.16.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) unobtrusive_flash (3.3.1) railties + uri (1.0.3) + useragent (0.16.11) warden (1.2.9) rack (>= 2.0.9) web-console (4.1.0) @@ -770,23 +719,25 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (4.6.0) + webdrivers (5.3.1) nokogiri (~> 1.6) rubyzip (>= 1.3.0) - selenium-webdriver (>= 3.0, < 4.0) + selenium-webdriver (~> 4.0, < 4.11) webmock (3.14.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.1) - websocket-driver (0.7.5) + webrick (1.9.1) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.5.4) + zeitwerk (2.7.3) PLATFORMS ruby @@ -801,8 +752,6 @@ DEPENDENCIES awesome_nested_set bootstrap-sass (~> 3.4.0) bootstrap-switch-rails (= 3.3.3) - bootstrap3-datetimepicker-rails (~> 4.17.47) - bullet byebug cancancan capybara @@ -814,9 +763,6 @@ DEPENDENCIES cloudinary cocoon countable-rails - country_select (< 7) - cucumber-rails - cucumber-rails-training-wheels daemons dalli database_cleaner @@ -833,22 +779,23 @@ DEPENDENCIES guard-rspec haml-lint haml-rails - httparty + haml_lint + i18n_data icalendar iso-639 jquery-datatables jquery-rails - jquery-ui-rails (~> 6.0.1) + jquery-ui-rails json-schema leaflet-rails letter_opener letter_opener_web + lograge matrix (~> 0.4) mina mini_magick money-rails next_rails - nokogiri omniauth omniauth-discourse! omniauth-facebook @@ -862,28 +809,8 @@ DEPENDENCIES pg prawn-qrcode prawn-rails - pronto - pronto-flay - pronto-haml - pronto-rubocop - pry - pry-byebug puma - rails (~> 7) - rails-assets-bootstrap! - rails-assets-bootstrap-markdown! - rails-assets-bootstrap-select! - rails-assets-date.format! - rails-assets-holderjs! - rails-assets-jquery! - rails-assets-jquery-smooth-scroll! - rails-assets-markdown! - rails-assets-momentjs! - rails-assets-spectrum! - rails-assets-tinycolor! - rails-assets-to-markdown (~> 3)! - rails-assets-trianglify! - rails-assets-waypoints! + rails (~> 8.0) rails-controller-testing rails-i18n recaptcha @@ -895,9 +822,13 @@ DEPENDENCIES rqrcode rspec-activemodel-mocks rspec-rails - rubocop-faker + rubocop + rubocop-capybara + rubocop-factory_bot + rubocop-performance rubocop-rails rubocop-rspec + rubocop-rspec_rails ruby-oembed sass-rails (>= 4.0.2) selectize-rails @@ -906,9 +837,7 @@ DEPENDENCIES sentry-ruby shoulda-matchers simplecov-cobertura - skylight (~> 5) sprockets-rails - sqlite3 stripe stripe-ruby-mock (~> 3.1.0.rc3) timecop @@ -922,7 +851,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 3.2.2p185 + ruby 3.3.9p170 BUNDLED WITH 2.3.26 diff --git a/Procfile b/Procfile index 84cab0c9d..79424b77f 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: bundle exec puma -C config/puma.rb +web: bundle exec puma -C config/puma.rb -p 4000 worker: bundle exec rails jobs:work diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8284fbf80..8c5ce7d78 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -37,8 +37,6 @@ //= require momentjs //= require leaflet //= require holderjs -//= require bootstrap-datetimepicker -//= require osem-datepickers //= require osem-datatables //= require osem-tickets //= require bootstrap-switch diff --git a/app/assets/javascripts/osem-datepickers.js b/app/assets/javascripts/osem-datepickers.js deleted file mode 100644 index e603d15d0..000000000 --- a/app/assets/javascripts/osem-datepickers.js +++ /dev/null @@ -1,62 +0,0 @@ -$(function () { - $("input[id^='datetimepicker']").datetimepicker({ - useCurrent: false, - sideBySide: true, - format: 'YYYY-MM-DD HH:mm' - }); - - $('.datetimepicker').datetimepicker({ - useCurrent: false, - sideBySide: true, - format: 'YYYY-MM-DD HH:mm' - }); - - $("#conference-start-datepicker").datetimepicker({ - useCurrent: false, - ignoreReadonly: true, - format: "YYYY-MM-DD", - }); - - $("#conference-end-datepicker").datetimepicker({ - useCurrent: false, - ignoreReadonly: true, - format: "YYYY-MM-DD" - }); - - $('#registration-period-start-datepicker').datetimepicker({ - format: 'YYYY-MM-DD' - }); - - $('#registration-period-end-datepicker').datetimepicker({ - format: 'YYYY-MM-DD' - }); - - $("#conference-start-datepicker").on("dp.change",function (e) { - $('#conference-end-datepicker').data("DateTimePicker").minDate(e.date); - if (!$('#conference-end-datepicker').val()) { - $('#conference-end-datepicker').data("DateTimePicker").date(e.date); - } - }); - - $("#conference-start-datepicker").change(function (e) { - $('#conference-start-datepicker').val()?$('#conference-end-datepicker').data("DateTimePicker").minDate(e.date):$('#conference-end-datepicker').data("DateTimePicker").minDate(null); - }); - - $("#conference-end-datepicker").on("dp.change",function (e) { - $('#conference-start-datepicker').data("DateTimePicker").maxDate(e.date); - }); - - $("#conference-end-datepicker").change(function (e) { - $('#conference-end-datepicker').val()?$('#conference-start-datepicker').data("DateTimePicker").maxDate(e.date):$('#conference-start-datepicker').data("DateTimePicker").maxDate(null); - }); - - $("#registration-period-start-datepicker").on("dp.change",function (e) { - $('#registration-period-end-datepicker').data("DateTimePicker").minDate(e.date); - if (!$('#registration-period-end-datepicker').val()) { - $('#registration-period-end-datepicker').data("DateTimePicker").date(e.date); - } - }); - $("#registration-period-end-datepicker").on("dp.change",function (e) { - $('#registration-period-start-datepicker').data("DateTimePicker").maxDate(e.date); - }); -} ); diff --git a/app/assets/javascripts/osem-schedule.js b/app/assets/javascripts/osem-schedule.js index b38ae2cc8..a683d4723 100644 --- a/app/assets/javascripts/osem-schedule.js +++ b/app/assets/javascripts/osem-schedule.js @@ -49,7 +49,7 @@ var Schedule = { room_id: new_parent.attr("room_id"), start_time: (new_parent.attr("date") + ' ' + new_parent.attr("hour")) }}; - if (event_schedule_id > 0) { + if(event_schedule_id){ type = 'PUT'; my_url += `/${event_schedule_id}`; } else { diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 31a1fdae0..974c6a811 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -7,7 +7,6 @@ *= require selectize *= require selectize.bootstrap3 *= require bootstrap-markdown - *= require bootstrap-datetimepicker *= require bootstrap-select *= require osem diff --git a/app/assets/stylesheets/jquery-ui-timepicker-addon.css b/app/assets/stylesheets/jquery-ui-timepicker-addon.css deleted file mode 100644 index b93a85f62..000000000 --- a/app/assets/stylesheets/jquery-ui-timepicker-addon.css +++ /dev/null @@ -1,10 +0,0 @@ -.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } -.ui-timepicker-div dl { text-align: left; } -.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } -.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } -.ui-timepicker-div td { font-size: 90%; } -.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } - -.ui-timepicker-rtl{ direction: rtl; } -.ui-timepicker-rtl dl { text-align: right; } -.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } \ No newline at end of file diff --git a/app/assets/stylesheets/strap-on.scss b/app/assets/stylesheets/strap-on.scss index bd2d3b38b..c0ed17dc8 100644 --- a/app/assets/stylesheets/strap-on.scss +++ b/app/assets/stylesheets/strap-on.scss @@ -1,6 +1,13 @@ // Place bootstrap variable customizations in the file below. + +$navbar-default-bg: #299a0b; +$navbar-default-link-active-bg: #DFE0DF; +$navbar-default-border: 1px solid #d4d4d4; +$navbar-default-color: #ffffff; +$navbar-default-link-color: #ffffff; +$navbar-default-link-hover-color: #000000; @import "osem-variables"; -@import 'bootstrap-datetimepicker'; + @import "bootstrap-sprockets"; // diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index 2229d983d..ed6adef3e 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -21,12 +21,18 @@ def verify_user_admin return false end unless (current_user.has_cached_role? :organizer, :any) || (current_user.has_cached_role? :cfp, :any) || - (current_user.has_cached_role? :info_desk, - :any) || (current_user.has_cached_role? :organization_admin, :any) || - (current_user.has_cached_role? :volunteers_coordinator, :any) || + (current_user.has_cached_role? :info_desk, :any) || (current_user.has_cached_role? :volunteers_coordinator, :any) || (current_user.has_cached_role? :track_organizer, :any) || current_user.is_admin raise CanCan::AccessDenied.new('You are not authorized to access this page.') end end + + def sign_in_path + if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true' + User.ichain_login_url + else + new_user_session_path + end + end end end diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 17d2bc131..4e74a3a98 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -8,7 +8,7 @@ class ConferencesController < Admin::BaseController def index # Redirect to new form if there is no conference - if Conference.count == 0 + if Conference.none? redirect_to new_admin_conference_path return end @@ -90,7 +90,7 @@ def update @conference.assign_attributes(conference_params) send_mail_on_conf_update = @conference.notify_on_dates_changed? - if @conference.update(conference_params) + if @conference.save ConferenceDateUpdateMailJob.perform_later(@conference) if send_mail_on_conf_update redirect_to edit_admin_conference_path(id: @conference.short_title), notice: 'Conference was successfully updated.' @@ -180,7 +180,7 @@ def conference_params :use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers, :color, :sponsorship_levels_attributes, :sponsors_attributes, - :registration_limit, :organization_id, :ticket_layout, + :registration_limit, :code_of_conduct, :ticket_layout, :booth_limit, :custom_css, :registered_attendees_message) end end diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index 939b4d967..1a050136b 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -46,15 +46,8 @@ def show @votes = @event.votes.includes(:user) @difficulty_levels = @program.difficulty_levels @versions = @event.versions | - PaperTrail::Version.where(item_type: 'Commercial').where('object LIKE ?', - "%commercialable_id: #{@event.id}\ncommercialable_type: Event%") | - PaperTrail::Version.where(item_type: 'Commercial').where('object_changes LIKE ?', - "%commercialable_id:\n- \n- #{@event.id}\ncommercialable_type:\n- \n- Event%") | - PaperTrail::Version.where(item_type: 'Vote').where('object_changes LIKE ?', - "%\nevent_id:\n- \n- #{@event.id}\n%") | - PaperTrail::Version.where(item_type: 'Vote').where('object LIKE ?', "%\nevent_id: #{@event.id}\n%") | - PaperTrail::Version.where(item_type: 'EventUser').where('object_changes LIKE ?', - "%\nevent_id:\n-\n- #{@event.id}\n%") + @event.commercials.map(&:versions).flatten | + @event.votes.map(&:versions).flatten end def edit @@ -63,7 +56,6 @@ def edit @comment_count = @event.comment_threads.count @user = @event.submitter @url = admin_conference_program_event_path(@conference.short_title, @event) - @languages = @program.languages_list @superevents = @program.events.where(superevent: true) end @@ -78,7 +70,6 @@ def comment end def update - @languages = @program.languages_list if @event.update(event_params) if request.xhr? @@ -96,7 +87,6 @@ def update def create @url = admin_conference_program_events_path(@conference.short_title, @event) - @languages = @program.languages_list @event.submitter = current_user @superevents = @program.events.where(superevent: true) @@ -111,7 +101,6 @@ def create def new @url = admin_conference_program_events_path(@conference.short_title, @event) - @languages = @program.languages_list @superevents = @program.events.where(superevent: true) end diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb deleted file mode 100644 index f885edb8d..000000000 --- a/app/controllers/admin/organizations_controller.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -module Admin - class OrganizationsController < Admin::BaseController - load_and_authorize_resource :organization - before_action :verify_user, only: %i[assign_org_admins unassign_org_admins] - - def index - @organizations = Organization.all - end - - def create - @organization = Organization.new(organization_params) - if @organization.save - redirect_to admin_organizations_path, - notice: 'Organization successfully created' - else - redirect_to new_admin_organization_path, - error: @organization.errors.full_messages.join(', ') - end - end - - def new - @organization = Organization.new - end - - def edit; end - - def update - if @organization.update(organization_params) - redirect_to admin_organizations_path, - notice: 'Organization successfully updated' - else - redirect_to edit_admin_organization_path(@organization), - error: @organization.errors.full_messages.join(', ') - end - end - - def destroy - if @organization.destroy - redirect_to admin_organizations_path, - notice: 'Organization successfully destroyed' - else - redirect_to admin_organizations_path, - error: 'Organization cannot be destroyed' - end - end - - def assign_org_admins - if @user.has_cached_role? 'organization_admin', @organization - flash[:error] = "User #{@user.email} already has the role organization admin" - elsif @user.add_role 'organization_admin', @organization - flash[:notice] = "Successfully added role organization admin to user #{@user.email}" - else - flash[:error] = "Coud not add role organization admin to #{@user.email}" - end - - redirect_to admins_admin_organization_path(@organization) - end - - def unassign_org_admins - if @user.remove_role 'organization_admin', @organization - flash[:notice] = "Successfully removed role organization admin from user #{@user.email}" - else - flash[:error] = "Could not remove role organization admin from user #{@user.email}" - end - - redirect_to admins_admin_organization_path(@organization) - end - - def admins - @role = @organization.roles.first - @users = @role.users - render 'show_org_admins' - end - - private - - def user_params - params.require(:user).permit(:email) - end - - def verify_user - @user = User.find_by(email: user_params[:email]) - unless @user - redirect_to admins_admin_organization_path(@organization), - error: 'Could not find user. Please provide a valid email!' - nil - end - end - - def organization_params - params.require(:organization).permit( - :name, :description, :picture, :code_of_conduct - ) - end - end -end diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index ca455dce8..d69e1ab11 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -69,7 +69,7 @@ def toggle_user end # The conference must have at least 1 organizer - if @role.name == 'organizer' && state == 'false' && @role.users.count == 1 + if @role.name == 'organizer' && state == 'false' && @role.users.one? redirect_to admin_conference_role_path(@conference.short_title, @role.name), error: 'The conference must have at least 1 organizer!' return diff --git a/app/controllers/admin/versions_controller.rb b/app/controllers/admin/versions_controller.rb index 723c1d972..5f9987e9b 100644 --- a/app/controllers/admin/versions_controller.rb +++ b/app/controllers/admin/versions_controller.rb @@ -14,11 +14,6 @@ def index ).pluck(:short_title) end - if current_user.has_cached_role? :organization_admin, :any - @conferences_with_role = Organization.with_role('organization_admin', current_user).map do |org| - org.conferences.pluck :short_title - end.flatten - end @conferences_with_role.uniq! return if @conference.blank? diff --git a/app/controllers/admin/volunteers_controller.rb b/app/controllers/admin/volunteers_controller.rb index c93ee9721..372794874 100644 --- a/app/controllers/admin/volunteers_controller.rb +++ b/app/controllers/admin/volunteers_controller.rb @@ -3,6 +3,7 @@ module Admin class VolunteersController < Admin::BaseController include VolunteersHelper + load_and_authorize_resource :conference, find_by: :short_title def index diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 672afae83..8d244e7f4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base before_action :set_paper_trail_whodunnit include ApplicationHelper include Pagy::Backend + add_flash_types :error protect_from_forgery with: :exception, prepend: true before_action :store_location diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 492516829..a4394101f 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -49,19 +49,23 @@ def show end if @splashpage.include_program? @highlights = @conference.highlighted_events.includes(:speakers, :speaker_event_users) + load_happening_now if @splashpage.include_happening_now # SNAPCON if @splashpage.include_tracks? @tracks = @conference.confirmed_tracks.eager_load( :room ).order('tracks.name') end - @booths = @conference.confirmed_booths.order('title') if @splashpage.include_booths? - load_happening_now if @splashpage.include_happening_now + if splashpage.include_booths + @booths = @conference.confirmed_booths.order(:title) + end + end + if splashpage.include_registrations || splashpage.include_tickets + @tickets = @conference.tickets.visible.order(:price_cents) # SNAPCON end - if @splashpage.include_registrations? || @splashpage.include_tickets? - @tickets = @conference.tickets.visible.order('price_cents') + if splashpage.include_lodgings + @lodgings = @conference.lodgings.order(:name) end - @lodgings = @conference.lodgings.order('id') if @splashpage.include_lodgings? - if @splashpage.include_sponsors? + if splashpage.include_sponsors @sponsorship_levels = @conference.sponsorship_levels.eager_load( :sponsors ).order('sponsorship_levels.position ASC', 'sponsors.name') @@ -115,6 +119,8 @@ def calendar end end + def code_of_conduct; end + private def conference_finder_conditions diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb deleted file mode 100644 index 28696d335..000000000 --- a/app/controllers/organizations_controller.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class OrganizationsController < ApplicationController - load_and_authorize_resource :organization - - def index - @organizations = Organization.all - end - - def code_of_conduct - @title = "#{@organization.name}: Code of Conduct" - @content = @organization.code_of_conduct - render 'document' - end - - def conferences - @current = @organization.conferences.upcoming.reorder(start_date: :asc) - @antiquated = @organization.conferences.past - render '/conferences/index' - end -end diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 2c3281e9a..b3ec2fff8 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -29,13 +29,11 @@ def show def new @user = User.new @url = conference_program_proposals_path(@conference.short_title) - @languages = @program.languages_list @superevents = @program.super_events end def edit @url = conference_program_proposal_path(@conference.short_title, params[:id]) - @languages = @program.languages_list @superevents = @program.events.where(superevent: true) end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 492c98a7f..022336165 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -130,14 +130,6 @@ def event_types_sentence(conference, is_admin) end end - def sign_in_path - if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true' - new_user_ichain_session_path - else - new_user_session_path - end - end - def rescheduling_hint(affected_event_count) if affected_event_count > 0 "You have #{affected_event_count} scheduled #{'event'.pluralize(affected_event_count)}. Changing the conference hours will unschedule those scheduled outside the conference hours." @@ -157,31 +149,19 @@ def hidden_if_conference_over(conference) # TODO: If conference is defined, the alt text should be conference name. def nav_root_link_for(conference = nil) path = conference&.id.present? ? conference_path(conference) : root_path + link_text = conference.present? ? conference.short_title : ENV.fetch('OSEM_NAME', 'OSEM') link_to( - image_tag(conference_logo_url(conference), alt: nav_link_text(conference)), + image_tag(conference_logo_url(conference), alt: "#{link_text} homepage"), path, class: 'navbar-brand', - title: nav_link_text(conference) + title: link_text ) end - # TODO-SNAPCON: This should be the conference title. - def nav_link_text(conference = nil) - conference.try(:organization).try(:name) || ENV.fetch('OSEM_NAME', 'OSEM') - end - - # TODO: Consider Renaming this? - # TODO: Allow passing in an organization def conference_logo_url(conference = nil) - return DEFAULT_LOGO unless conference + return conference.picture.thumb.url if conference && conference.picture.present? - if conference.picture.present? - conference.picture.thumb.url - elsif conference.organization&.picture.present? - conference.organization.picture.thumb.url - else - DEFAULT_LOGO - end + DEFAULT_LOGO end # returns the url to be used for logo on basis of sponsorship level position @@ -210,7 +190,10 @@ def inyourtz(time, timezone, &) end def visible_conference_links + # @visible_conference_links ||= + # Conference.all.select(:id, :organization_id, :title, :short_title, :start_date).includes(:splashpage, :organization).select { |conf| can?(:show, conf) }.group_by(&:organization) @visible_conference_links ||= - Conference.all.select(:id, :organization_id, :title, :short_title, :start_date).includes(:splashpage, :organization).select { |conf| can?(:show, conf) }.group_by(&:organization) + Conference.all.select(:id, :title, :short_title, :start_date).includes(:splashpage).select { |conf| can?(:show, conf) }.group_by { |conf| conf.title.split(' ').first } + end end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 86f129806..3208a99e6 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -44,8 +44,8 @@ def replacement_event_notice(event_schedule, styles: '') end def canceled_replacement_event_label(event, event_schedule, *label_classes) - if event.state == 'canceled' || event.state == 'withdrawn' - content_tag :span, 'CANCELED', class: (%w[label label-danger] + label_classes) + if ['canceled', 'withdrawn'].include?(event.state) + content_tag :span, 'CANCELED', class: (['label', 'label-danger'] + label_classes) elsif event_schedule.present? && event_schedule.replacement?(@withdrawn_event_schedules) content_tag :span, 'REPLACEMENT', class: (%w[label label-info] + label_classes) end diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index a2bff0cec..ea8b6a6ed 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -97,14 +97,6 @@ def class_for_todo(bool) bool ? 'todolist-ok' : 'todolist-missing' end - def word_pluralize(count, singular, plural = nil) - if count.positive? && count < 2 - singular - else - plural || singular.pluralize - end - end - # Returns black or white deppending on what of them contrast more with the # given color. Useful to print text in a coloured background. # hexcolor is a hex color of 7 characters, being the first one '#'. diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 11c455c2b..ef7125848 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -14,13 +14,7 @@ def omniauth_configured providers = [] Devise.omniauth_providers.each do |provider| - provider_key = "#{provider}_key" - provider_secret = "#{provider}_secret" - unless Rails.application.secrets.send(provider_key).blank? || Rails.application.secrets.send(provider_secret).blank? - providers << provider - end - providers << provider if ENV.fetch("OSEM_#{provider.upcase}_KEY", - nil).present? && ENV.fetch("OSEM_#{provider.upcase}_SECRET", nil).present? + providers << provider if ENV.fetch("OSEM_#{provider.upcase}_KEY", nil).present? && ENV.fetch("OSEM_#{provider.upcase}_SECRET", nil).present? end providers.uniq diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index 04af38a1c..38eb40e3c 100644 --- a/app/helpers/versions_helper.rb +++ b/app/helpers/versions_helper.rb @@ -8,15 +8,6 @@ def link_if_alive(version, link_text, link_url, conference) version.item && conference ? link_to(link_text, link_url) : "#{link_text} with ID #{version.item_id}" end - def link_to_organization(organization_id) - return 'deleted organization' unless organization_id - - org = Organization.find_by(id: organization_id) - return current_or_last_object_state('Organization', organization_id).try(:name) unless org - - org.name.to_s - end - def link_to_conference(conference_id) return 'deleted conference' if conference_id.nil? diff --git a/app/models/ability.rb b/app/models/ability.rb index 0211ee8bc..78ecb69e9 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -17,7 +17,6 @@ def initialize(user) # Abilities for not signed in users (guests) def not_signed_in - can %i[index conferences code_of_conduct], Organization can [:index], Conference can [:show], Conference do |conference| conference.splashpage&.public == true @@ -87,7 +86,6 @@ def signed_in(user) end end - can :index, Organization can :index, Ticket do |ticket| ticket.visible end diff --git a/app/models/admin_ability.rb b/app/models/admin_ability.rb index 07e72ec20..2c78f99e1 100644 --- a/app/models/admin_ability.rb +++ b/app/models/admin_ability.rb @@ -30,7 +30,6 @@ def common_abilities_for_roles(user) (conference.registration_open? && !conference.registration_limit_exceeded?) || conference.program.speakers.confirmed.include?(user) end - can %i[index admins], Organization can :index, Ticket can :manage, TicketPurchase, user_id: user.id can %i[new create], Payment, user_id: user.id @@ -81,7 +80,6 @@ def common_abilities_for_roles(user) # Abilities for signed in users with roles def signed_in_with_roles(user) - signed_in_with_organization_admin_role(user) if user.has_cached_role? :organization_admin, :any signed_in_with_organizer_role(user) if user.has_cached_role? :organizer, :any signed_in_with_cfp_role(user) if user.has_cached_role? :cfp, :any signed_in_with_info_desk_role(user) if user.has_cached_role? :info_desk, :any @@ -90,26 +88,9 @@ def signed_in_with_roles(user) common_abilities_for_roles(user) end - def signed_in_with_organization_admin_role(user) - org_ids_for_organization_admin = Organization.with_role(:organization_admin, user).pluck(:id) - conf_ids_for_organization_admin = Conference.where(organization_id: org_ids_for_organization_admin).pluck(:id) - - can %i[read update destroy assign_org_admins unassign_org_admins admins], Organization, - id: org_ids_for_organization_admin - can :new, Conference - can :manage, Conference, organization_id: org_ids_for_organization_admin - can %i[index show], Role - - can %i[index revert_object revert_attribute], PaperTrail::Version, - organization_id: org_ids_for_organization_admin - - signed_in_with_organizer_role(user, conf_ids_for_organization_admin) - end - - def signed_in_with_organizer_role(user, conf_ids_for_organization_admin = []) - # ids of all the conferences for which the user has the 'organizer' role and - # conferences that belong to organizations for which user is 'organization_admin' - conf_ids = conf_ids_for_organization_admin.concat(Conference.with_role(:organizer, user).pluck(:id)).uniq + def signed_in_with_organizer_role(user) + # ids of all the conferences for which the user has the 'organizer' role + conf_ids = Conference.with_role(:organizer, user).pluck(:id) # ids of all the tracks that belong to the programs of the above conferences track_ids = Track.joins(:program).where('programs.conference_id IN (?)', conf_ids).pluck(:id) @@ -160,7 +141,7 @@ def signed_in_with_organizer_role(user, conf_ids_for_organization_admin = []) # Abilities for Role (Conference resource) can [:index, :show], Role do |role| - role.resource_type == 'Conference' || role.resource_type == 'Track' + ['Conference', 'Track'].include?(role.resource_type) end can [:edit, :update, :toggle_user], Role do |role| @@ -200,7 +181,7 @@ def signed_in_with_cfp_role(user) # Abilities for Role (Conference resource) can [:index, :show], Role do |role| - role.resource_type == 'Conference' || role.resource_type == 'Track' + ['Conference', 'Track'].include?(role.resource_type) end # Can add or remove users from role, when user has that same role for the conference # Eg. If you are member of the CfP team, you can add more CfP team members (add users to the role 'CfP') @@ -238,7 +219,7 @@ def signed_in_with_info_desk_role(user) # Abilities for Role (Conference resource) can [:index, :show], Role do |role| - role.resource_type == 'Conference' || role.resource_type == 'Track' + ['Conference', 'Track'].include?(role.resource_type) end # Can add or remove users from role, when user has that same role for the conference # Eg. If you are member of the CfP team, you can add more CfP team members (add users to the role 'CfP') @@ -263,7 +244,7 @@ def signed_in_with_volunteers_coordinator_role(user) # Abilities for Role (Conference resource) can [:index, :show], Role do |role| - role.resource_type == 'Conference' || role.resource_type == 'Track' + ['Conference', 'Track'].include?(role.resource_type) end # Can add or remove users from role, when user has that same role for the conference # Eg. If you are member of the CfP team, you can add more CfP team members (add users to the role 'CfP') @@ -299,7 +280,7 @@ def signed_in_with_track_organizer_role(user) # Show Roles in the admin sidebar and allow authorization of the index action can [:index, :show], Role do |role| - role.resource_type == 'Conference' || role.resource_type == 'Track' + ['Conference', 'Track'].include?(role.resource_type) end can :toggle_user, Role do |role| diff --git a/app/models/booth.rb b/app/models/booth.rb index b2cd0ff3b..47bc299f8 100644 --- a/app/models/booth.rb +++ b/app/models/booth.rb @@ -18,6 +18,7 @@ # class Booth < ApplicationRecord include ActiveRecord::Transitions + has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } belongs_to :conference diff --git a/app/models/cfp.rb b/app/models/cfp.rb index 87cb70cd1..d42c35501 100644 --- a/app/models/cfp.rb +++ b/app/models/cfp.rb @@ -137,10 +137,8 @@ def before_end_of_conference end def start_after_end_date - if start_date && end_date && start_date > end_date - errors - .add(:start_date, "can't be after the end date") - end + errors + .add(:start_date, "can't be after the end date") if start_date > end_date end def conference_id diff --git a/app/models/comment.rb b/app/models/comment.rb index 976c54d89..b476ea44e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -58,13 +58,13 @@ def has_children? # Helper class method to lookup all comments assigned # to all commentable types for a given user. scope :find_comments_by_user, lambda { |user| - where(user_id: user.id).order('created_at DESC') + where(user_id: user.id).order(created_at: :desc) } # Helper class method to look up all comments for # commentable class name and commentable id. scope :find_comments_for_commentable, lambda { |commentable_str, commentable_id| - where(commentable_type: commentable_str.to_s, commentable_id: commentable_id).order('created_at DESC') + where(commentable_type: commentable_str.to_s, commentable_id: commentable_id).order(created_at: :desc) } scope :find_since_last_login, lambda { |user| diff --git a/app/models/conference.rb b/app/models/conference.rb index 20e1ce441..20f488c4e 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -30,29 +30,27 @@ # use_vpositions :boolean default(FALSE) # created_at :datetime # updated_at :datetime -# organization_id :integer # # Indexes # -# index_conferences_on_organization_id (organization_id) # # rubocop:disable Metrics/ClassLength class Conference < ApplicationRecord include RevisionCount + require 'uri' - serialize :events_per_week, Hash + + serialize :events_per_week, type: Hash + # Needed to call 'Conference.with_role' in /models/ability.rb # Dependent destroy will fail as roles#destroy will be cancelled,hence delete_all resourcify :roles, dependent: :delete_all - default_scope { order('conferences.start_date DESC') } - scope :upcoming, -> { where('conferences.end_date >= ?', Date.current) } - scope :past, -> { where('conferences.end_date < ?', Date.current) } + default_scope { order(start_date: :desc) } + scope :upcoming, (-> { where(end_date: Date.current..) }) + scope :past, (-> { where(end_date: ...Date.current) }) - belongs_to :organization - delegate :code_of_conduct, to: :organization - - has_paper_trail ignore: %i[updated_at guid revision events_per_week], meta: { conference_id: :id } + has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id } has_and_belongs_to_many :questions @@ -81,7 +79,7 @@ class Conference < ApplicationRecord has_many :participants, through: :registrations, source: :user has_many :vdays, dependent: :destroy has_many :vpositions, dependent: :destroy - has_many :sponsorship_levels, -> { order('position ASC') }, dependent: :destroy + has_many :sponsorship_levels, -> { order(:position) }, dependent: :destroy has_many :sponsors, dependent: :destroy has_many :commercials, as: :commercialable, dependent: :destroy has_many :subscriptions, dependent: :destroy @@ -123,7 +121,6 @@ def after_conference :start_hour, :end_hour, :ticket_layout, - :organization, :timezone, presence: true validates :short_title, uniqueness: true @@ -140,7 +137,7 @@ def after_conference after_create :create_free_ticket after_update :delete_event_schedules - enum ticket_layout: { portrait: 0, landscape: 1 } + enum :ticket_layout, [:portrait, :landscape] ## # Checks if the user is registered to the conference @@ -150,8 +147,8 @@ def after_conference # ====Returns # * +false+ -> If the user is registered # * +true+ - If the user isn't registered - def user_registered?(user) - user.present? && registrations.where(user_id: user.id).present? + def user_registered? user + user.present? && registrations.where(user_id: user.id).any? end ## @@ -174,7 +171,7 @@ def register_user(user) registration.user = user if registration.save MailblusterEditLeadJob.perform_later( - user.id, add_tags: ["#{organization.name}-#{short_title}"] + user.id, add_tags: ["#{short_title}"] ) return registration end @@ -227,7 +224,7 @@ def registration_dates_given? def get_submissions_per_week result = [] - if program&.cfp && program&.events + if program&.cfp && program.events submissions = program.events.select(:week).group(:week).order(:week).count start_week = program.cfp.start_week weeks = program.cfp.weeks @@ -243,7 +240,7 @@ def get_submissions_per_week # ====Returns # * +Array+ -> e.g. 'Submitted' => [0, 3, 3, 5] -> first week 0 events, second week 3 events. def get_submissions_data - return [] unless program&.cfp && program&.events + return [] unless program&.cfp && program.events start_week = program.cfp.start_week get_events_per_week_by_state.collect do |state, values| @@ -267,10 +264,7 @@ def get_submissions_data # ====Returns # * +Array+ -> e.g. [0, 3, 3, 5] -> first week 0, second week 3 registrations def get_registrations_per_week - return [] unless registrations && - registration_period && - registration_period.start_date && - registration_period.end_date + return [] unless registrations && registration_period&.start_date && registration_period.end_date reg = registrations.group(:week).order(:week).count start_week = get_registration_start_week @@ -336,7 +330,7 @@ def registration_weeks result = 0 weeks = 0 if registration_period&.start_date && - registration_period&.end_date + registration_period.end_date weeks = Date.new(registration_period.start_date.year, 12, 31) .strftime('%W').to_i @@ -424,7 +418,7 @@ def get_status # * +hash+ -> user: submissions def self.get_top_submitter(limit = 5) submitter = EventUser.select(:user_id).where('event_role = ?', 'submitter').limit(limit).group(:user_id) - counter = submitter.order('count_all desc').count(:all) + counter = submitter.order(count_all: :desc).count(:all) calculate_user_submission_hash(submitter, counter) end @@ -435,9 +429,9 @@ def self.get_top_submitter(limit = 5) # * +hash+ -> user: submissions def get_top_submitter(limit = 5) submitter = EventUser.joins(:event).select(:user_id) - .where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id) - .limit(limit).group(:user_id) - counter = submitter.order('count_all desc').count(:all) + .where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id) + .limit(limit).group(:user_id) + counter = submitter.order(count_all: :desc).count(:all) Conference.calculate_user_submission_hash(submitter, counter) end @@ -646,12 +640,12 @@ def tracks_distribution(state = nil) # * +ActiveRecord+ def self.get_active_conferences_for_dashboard result = Conference.where('start_date > ?', Time.now) - .select('id, short_title, color, start_date, organization_id') + .select('id, short_title, color, start_date') if result.empty? result = Conference - .select('id, short_title, color, start_date, organization_id').limit(2) - .order(start_date: :desc) + .select('id, short_title, color, start_date').limit(2) + .order(start_date: :desc) end result end @@ -662,7 +656,7 @@ def self.get_active_conferences_for_dashboard # ====Returns # * +ActiveRecord+ def self.get_conferences_without_active_for_dashboard(active_conferences) - result = Conference.select('id, short_title, color, start_date, organization_id').order(start_date: :desc) + result = Conference.select('id, short_title, color, start_date').order(start_date: :desc) result - active_conferences end @@ -897,10 +891,12 @@ def get_events_per_week_by_state events_per_week.each do |week, values| week = Date.parse(week) unless week.respond_to?(:strftime) values.each do |state, value| - next unless %i[confirmed unconfirmed].include?(state) - - result[state.to_s.capitalize] = {} unless result[state.to_s.capitalize] - result[state.to_s.capitalize][week.strftime('%W').to_i] = value + if %i(confirmed unconfirmed).include?(state) + unless result[state.to_s.capitalize] + result[state.to_s.capitalize] = {} + end + result[state.to_s.capitalize][DateTime.parse(week).strftime('%W').to_i] = value + end end end @@ -991,7 +987,7 @@ def calculate_setup_progress(result) # * +True+ -> One difficulty level or more # * +False+ -> No diffculty level def difficulty_levels_set? - program.difficulty_levels.count > 0 + program.difficulty_levels.any? end ## @@ -1001,7 +997,7 @@ def difficulty_levels_set? # * +True+ -> One difficulty level or more # * +False+ -> No diffculty level def event_types_set? - program.event_types.count > 0 + program.event_types.any? end ## @@ -1011,7 +1007,7 @@ def event_types_set? # * +True+ -> One track or more # * +False+ -> No track def tracks_set? - program.tracks.count > 0 + program.tracks.any? end ## @@ -1021,7 +1017,7 @@ def tracks_set? # * +True+ -> One room or more # * +False+ -> No room def rooms_set? - venue.present? && venue.rooms.count > 0 + venue.present? && venue.rooms.any? end # Checks if the conference has a venue object. diff --git a/app/models/event.rb b/app/models/event.rb index 373a2ae63..e258cd786 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -44,9 +44,9 @@ class Event < ApplicationRecord include ActionView::Helpers::SanitizeHelper include ActiveRecord::Transitions include RevisionCount - include FormatHelper + include FormatHelper # SNAPCON (verify if still needed) - has_paper_trail on: %i[create update], ignore: %i[updated_at guid week], meta: { conference_id: :conference_id } + has_paper_trail on: [:create, :update], ignore: [:updated_at, :guid, :week], meta: { conference_id: :conference_id } acts_as_commentable diff --git a/app/models/event_schedule.rb b/app/models/event_schedule.rb index 834971b02..e3b02f998 100644 --- a/app/models/event_schedule.rb +++ b/app/models/event_schedule.rb @@ -157,7 +157,7 @@ def replaced_event_schedules end def start_after_end_hour - return unless event && start_time && event.program && event.program.conference && event.program.conference.end_hour + return unless event && start_time && event.program&.conference&.end_hour if start_time.hour >= event.program.conference.end_hour errors.add(:start_time, @@ -166,9 +166,7 @@ def start_after_end_hour end def start_before_start_hour - unless event && start_time && event.program && event.program.conference && event.program.conference.start_hour - return - end + return unless event && start_time && event.program&.conference&.start_hour if start_time.hour < event.program.conference.start_hour errors.add(:start_time, diff --git a/app/models/organization.rb b/app/models/organization.rb deleted file mode 100644 index d1930403e..000000000 --- a/app/models/organization.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: organizations -# -# id :bigint not null, primary key -# code_of_conduct :text -# description :text -# name :string not null -# picture :string -# -class Organization < ApplicationRecord - resourcify :roles, dependent: :delete_all - - has_paper_trail - - has_many :conferences, dependent: :destroy - - after_create :create_roles - - validates :name, - uniqueness: { - case_sensitive: false - }, - presence: true - - mount_uploader :picture, PictureUploader, mount_on: :picture - - private - - def create_roles - roles.where(name: 'organization_admin').first_or_create(description: 'For the administrators of an organization and its conferences') - end -end diff --git a/app/models/payment.rb b/app/models/payment.rb index 5fa61c2f9..cd57d7be6 100644 --- a/app/models/payment.rb +++ b/app/models/payment.rb @@ -27,7 +27,7 @@ class Payment < ApplicationRecord validates :conference_id, presence: true validates :currency, presence: true - enum status: { + enum :status, { unpaid: 0, success: 1, failure: 2 diff --git a/app/models/registration_period.rb b/app/models/registration_period.rb index 32043ef17..40985f049 100644 --- a/app/models/registration_period.rb +++ b/app/models/registration_period.rb @@ -17,27 +17,32 @@ class RegistrationPeriod < ApplicationRecord has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } validates :start_date, :end_date, presence: true - validate :before_end_of_conference + validate :start_before_end_of_conference + validate :end_before_end_of_conference validate :start_date_before_end_date private - def before_end_of_conference - if conference&.end_date && start_date && (start_date > conference.end_date) - errors - .add(:start_date, "can't be after the conference end date (#{conference.end_date})") - end + def start_before_end_of_conference + return unless conference + return unless start_date - if conference&.end_date && end_date && (end_date > conference.end_date) - errors - .add(:end_date, "can't be after the conference end date (#{conference.end_date})") - end + errors + .add(:start_date, "can't start after the conference end date (#{conference.end_date})") if start_date > conference.end_date + end + + def end_before_end_of_conference + return unless conference + return unless end_date + + errors + .add(:end_date, "can't end after the conference end date (#{conference.end_date})") if end_date > conference.end_date end def start_date_before_end_date - if start_date && end_date && start_date > end_date - errors - .add(:start_date, "can't be after the end date") - end + return unless start_date && end_date + + errors + .add(:start_date, "can't be after the end date") if start_date > end_date end end diff --git a/app/models/role.rb b/app/models/role.rb index 5ad6e85d3..8cf32e86b 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -24,7 +24,7 @@ class Role < ApplicationRecord has_paper_trail on: %i[create update], only: %i[name description], - meta: { conference_id: :conference_id, organization_id: :organization_id } + meta: { conference_id: :conference_id } before_destroy :cancel scopify @@ -37,10 +37,6 @@ def conference_id resource_type == 'Conference' ? resource_id : nil end - def organization_id - resource_type == 'Organization' ? resource_id : nil - end - private # Needed to ensure that removing all user from role doesn't remove role. diff --git a/app/models/room.rb b/app/models/room.rb index 8bb55931e..0ec6f02c4 100644 --- a/app/models/room.rb +++ b/app/models/room.rb @@ -15,6 +15,7 @@ # class Room < ApplicationRecord include RevisionCount + belongs_to :venue has_many :event_schedules, dependent: :destroy has_many :tracks diff --git a/app/models/survey.rb b/app/models/survey.rb index 75465bd4f..6d949c827 100644 --- a/app/models/survey.rb +++ b/app/models/survey.rb @@ -24,7 +24,7 @@ class Survey < ActiveRecord::Base has_many :survey_questions, dependent: :destroy has_many :survey_submissions, dependent: :destroy - enum target: { after_conference: 0, during_registration: 1, after_event: 2 } + enum :target, [:after_conference, :during_registration, :after_event] validates :title, presence: true ## @@ -44,7 +44,7 @@ def active? now = Time.current.in_time_zone(timezone) if start_date && end_date - now >= start_date && now <= end_date + now.between?(start_date, end_date) elsif start_date && !end_date now >= start_date elsif !start_date && end_date diff --git a/app/models/survey_question.rb b/app/models/survey_question.rb index c53f153c2..c1762e200 100644 --- a/app/models/survey_question.rb +++ b/app/models/survey_question.rb @@ -18,7 +18,7 @@ class SurveyQuestion < ActiveRecord::Base has_many :survey_replies, dependent: :destroy # Order of this list should not be changed without proper action! - enum kind: { boolean: 0, choice: 1, string: 2, text: 3, datetime: 4, numeric: 5 } + enum :kind, [:boolean, :choice, :string, :text, :datetime, :numeric] ICONS = { boolean: 'circle-dot', choice: 'square-check', string: 'pen-to-square', text: 'align-left', datetime: 'clock', numeric: 'hashtag' }.freeze diff --git a/app/models/ticket.rb b/app/models/ticket.rb index f2c3997df..75a753e08 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -96,7 +96,7 @@ def tickets_sold def tickets_of_conference_have_same_currency tickets = Ticket.where(conference_id: conference_id) - return if tickets.count.zero? || (tickets.count == 1 && self == tickets.first) + return if tickets.none? || (tickets.one? && self == tickets.first) unless tickets.all? { |t| t.price_currency == price_currency } errors.add(:price_currency, 'is different from the existing tickets of this conference.') diff --git a/app/models/ticket_purchase.rb b/app/models/ticket_purchase.rb index 2577269e8..38f04ab7a 100644 --- a/app/models/ticket_purchase.rb +++ b/app/models/ticket_purchase.rb @@ -132,8 +132,6 @@ def render_email_data(event_template) end end -private - def set_week self.week = created_at.strftime('%W') save! diff --git a/app/models/track.rb b/app/models/track.rb index d9c51f6b5..5ac3af5c3 100644 --- a/app/models/track.rb +++ b/app/models/track.rb @@ -271,12 +271,12 @@ def overlapping (program.tracks.accepted + program.tracks.confirmed - [self]).each do |existing_track| next unless existing_track.room == room && existing_track.start_date && existing_track.end_date - next unless (start_date >= existing_track.start_date && start_date <= existing_track.end_date) || - (end_date >= existing_track.start_date && end_date <= existing_track.end_date) || - (start_date <= existing_track.start_date && end_date >= existing_track.end_date) - - errors.add(:track, 'has overlapping dates with a confirmed or accepted track in the same room') - break + if start_date.between?(existing_track.start_date, existing_track.end_date) || + end_date.between?(existing_track.start_date, existing_track.end_date) || + start_date <= existing_track.start_date && end_date >= existing_track.end_date + errors.add(:track, 'has overlapping dates with a confirmed or accepted track in the same room') + break + end end end end diff --git a/app/models/user.rb b/app/models/user.rb index bfa75bb97..4c9f4e0bf 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -82,6 +82,7 @@ def for_registration(conference) # A user may have an uploaded avatar or use gravatar. # The uploaded picture takes precedence. include Gravtastic + gravtastic size: 32 mount_uploader :picture, PictureUploader, mount_on: :picture @@ -110,7 +111,7 @@ def for_registration(conference) where('last_sign_in_at > ?', Date.today - 3.months).where(is_disabled: false) } scope :unconfirmed, -> { where('confirmed_at IS NULL') } - scope :dead, -> { where('last_sign_in_at < ?', Date.today - 1.year) } + scope :dead, -> { where(last_sign_in_at: ...(Date.today - 1.year)) } # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, @@ -172,6 +173,7 @@ def for_conference(conference) presence: true validate :biography_limit + validates :affiliation, length: { maximum: 150 } DISTRIBUTION_COLORS = { 'Active' => 'green', @@ -345,8 +347,7 @@ def manages_volunteers?(conference) end def registered - registrations = self.registrations - if registrations.count == 0 + if registrations.none? 'None' else registrations.map { |r| r.conference.title }.join ', ' @@ -355,7 +356,7 @@ def registered def attended registrations_attended = registrations.where(attended: true) - if registrations_attended.count == 0 + if registrations_attended.none? 'None' else registrations_attended.map { |r| r.conference.title }.join ', ' @@ -393,7 +394,7 @@ def count_registration_tickets(conference) end def self.empty? - User.count == 1 && User.first.email == 'deleted@localhost.osem' + User.one? && User.first.email == 'deleted@localhost.osem' end def dropdwon_display diff --git a/app/models/users_role.rb b/app/models/users_role.rb index 621d42d37..767468875 100644 --- a/app/models/users_role.rb +++ b/app/models/users_role.rb @@ -16,8 +16,8 @@ class UsersRole < ApplicationRecord belongs_to :role belongs_to :user - delegate :conference_id, :organization_id, to: :role + delegate :conference_id, to: :role has_paper_trail on: %i[create destroy], - meta: { conference_id: :conference_id, organization_id: :organization_id } + meta: { conference_id: :conference_id } end diff --git a/app/pdfs/ticket_pdf.rb b/app/pdfs/ticket_pdf.rb index de9c5ce3f..b330d6fd0 100644 --- a/app/pdfs/ticket_pdf.rb +++ b/app/pdfs/ticket_pdf.rb @@ -67,7 +67,6 @@ def draw_second_square move_down 70 draw_text @conference.title.to_s, at: [@mid_horizontal + 30, cursor - 30], size: 12 - draw_text @conference.organization.name.to_s, at: [@mid_horizontal + 30, cursor - 50], size: 12 if @conference.venue draw_text @conference.venue_name, at: [@mid_horizontal + 30, cursor - 70] draw_text @conference.venue_street, at: [@mid_horizontal + 30, cursor - 90] diff --git a/app/serializers/conference_serializer.rb b/app/serializers/conference_serializer.rb index 08bce729a..c04829db2 100644 --- a/app/serializers/conference_serializer.rb +++ b/app/serializers/conference_serializer.rb @@ -30,12 +30,9 @@ # use_vpositions :boolean default(FALSE) # created_at :datetime # updated_at :datetime -# organization_id :integer # # Indexes # -# index_conferences_on_organization_id (organization_id) -# class ConferenceSerializer < ActiveModel::Serializer include ApplicationHelper include Rails.application.routes.url_helpers diff --git a/app/views/admin/cfps/_form.html.haml b/app/views/admin/cfps/_form.html.haml index 3baf8c219..84131fa90 100644 --- a/app/views/admin/cfps/_form.html.haml +++ b/app/views/admin/cfps/_form.html.haml @@ -2,10 +2,12 @@ = f.hidden_field :cfp_type .form-group = f.label :start_date, "Start Date" - = f.text_field :start_date, class: 'form-control', id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + %abbr{title: 'This field is required'} * + = f.date_field :start_date, class: 'form-control', required: true .form-group = f.label :end_date, "End Date" - = f.text_field :end_date, class: 'form-control', id: 'registration-period-end-datepicker', start_date: @conference.start_date, end_date: @conference.end_date + %abbr{title: 'This field is required'} * + = f.date_field :end_date, class: 'form-control', required: true .form-group = f.label :description = f.text_area :description, rows: 15, data: { provide: 'markdown' } diff --git a/app/views/admin/conferences/_form_fields.html.haml b/app/views/admin/conferences/_form_fields.html.haml index c5439f1ac..239241839 100644 --- a/app/views/admin/conferences/_form_fields.html.haml +++ b/app/views/admin/conferences/_form_fields.html.haml @@ -1,9 +1,5 @@ %h4 Basic Information %hr -- if f.object.new_record? - .form-group - = f.label :organization, "Organization" - = f.select :organization_id, Organization.accessible_by(current_ability, :update).pluck(:name, :id) .form-group = f.label :title %abbr{title: 'This field is required'} * @@ -36,8 +32,32 @@ - if f.object.picture? = image_tag f.object.picture.thumb.url = f.file_field :picture - %span.help-block + .help-block This will be shown in the navigation bar and emails. + .form-group + = f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control' + .help-block + Rules governing behavior and dispute resolution... + = markdown_hint + = f.select :ticket_layout, Conference.ticket_layouts.keys, {}, class: 'form-control' + %span.help-block + Layout type for tickets of the conference. + +%h4 + Scheduling +%hr += f.time_zone_select :timezone, nil, { default: 'UTC' }, { class: 'form-control' } +%span.help-block + Please select in what time zone your conference will take place. +.form-group + = f.label :start_date, "Start Date" + %abbr{title: 'This field is required'} * + = f.date_field :start_date, required: true, class: 'form-control' +.form-group + = f.label :end_date, "End Date" + %abbr{title: 'This field is required'} * + = f.date_field :end_date, required: true, class: 'form-control' +- unless f.object.new_record? # We are showing more fields on the edit form .form-group = f.label :custom_css, "Custom CSS" = f.text_area :custom_css, rows: 10, class: 'form-control', html: { style: 'font-family: monospace' } diff --git a/app/views/admin/emails/index.html.haml b/app/views/admin/emails/index.html.haml index f60c4889f..a8988d359 100644 --- a/app/views/admin/emails/index.html.haml +++ b/app/views/admin/emails/index.html.haml @@ -33,7 +33,7 @@ 'data-body-input-id' => 'email_settings_registration_body', 'data-body-text' => "Dear {name},\n\nThank you for Registering for the conference {conference}.\nPlease complete your registration by filling out your travel information.\n\nIf you are unable to attend please unregister online:\n{registrationlink}\n\nFeel free to contact us with any questions or concerns.\nWe look forward to see you there.\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'registration_help' } Show Help - = render partial: 'shared/help', locals: { id: 'registration_help', show_event_variables: false, show_ticket_variables: false, show_ticket_variables: false } + = render partial: 'shared/help', locals: { id: 'registration_help', show_event_variables: false, show_ticket_variables: false } #proposal.tab-pane{ role: 'tabpanel' } .checkbox %label @@ -210,7 +210,7 @@ 'data-body-input-id' => 'email_settings_booths_rejection_body', 'data-body-text' => "Dear {name},\n\nThank you for your #{t'booth'} request {booth_title} for the conference {conference}.\n\nUnfortunately, we are sorry to inform you that your request has been rejected.\n\n\nBest wishes\n\n{conference} Team" } Load Template %a.btn.btn-link.control_label.template_help_link{ 'data-name' => 'booth_rejection_help' } Show help - = render partial: 'shared/help', locals: {id: 'booth_rejection_help', show_event_variables: false, show_ticket_variables: false, show_ticket_variables: false} + = render partial: 'shared/help', locals: {id: 'booth_rejection_help', show_event_variables: false, show_ticket_variables: false} .row .col-md-12 diff --git a/app/views/admin/event_types/_form.html.haml b/app/views/admin/event_types/_form.html.haml index 234d50293..cc111fbd3 100644 --- a/app/views/admin/event_types/_form.html.haml +++ b/app/views/admin/event_types/_form.html.haml @@ -20,10 +20,12 @@ = f.check_box :enable_public_submission, class: 'switch-checkbox' .form-group = f.label :minimum_abstract_length + (words) %abbr{title: 'This field is required'} * = f.number_field :minimum_abstract_length, size: 3, required: true, class: 'form-control' .form-group = f.label :maximum_abstract_length + (words) %abbr{title: 'This field is required'} * = f.number_field :maximum_abstract_length, size: 3, required: true, class: 'form-control' .form-group diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml deleted file mode 100644 index 13544440b..000000000 --- a/app/views/admin/organizations/_form.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -= form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f| - .form-group - = f.label :name, "Name" - %abbr{title: 'This field is required'} * - = f.text_field :name, required: true, class: 'form-control', placeholder: 'Name' - .form-group - = f.text_area :description, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Decribe about your organization...' - %span.help-block - = markdown_hint - .form-group - = f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Rules governing behavior and dispute resolution...' - %span.help-block - = markdown_hint - .form-group - = image_tag f.object.picture.thumb.url if f.object.picture? - = f.file_field :picture - %p.text-right - %button{type: 'submit', class: 'btn btn-success'} - - if @organization.new_record? - Create Organization - - else - Update Organization diff --git a/app/views/admin/organizations/_users_with_org_admin_role.haml b/app/views/admin/organizations/_users_with_org_admin_role.haml deleted file mode 100644 index 0632afbf0..000000000 --- a/app/views/admin/organizations/_users_with_org_admin_role.haml +++ /dev/null @@ -1,26 +0,0 @@ -.page-header - %h3 Users (#{users.length}) -- if users.present? - %table.datatable#users - %thead - %tr - %th Name - %th Email - - if ( can? :unassign_org_admins, organization ) - %th - Actions - %tbody - - users.each do |user| - %tr - %td= user.name - %td= user.email - - if ( can? :unassign_org_admins, organization ) - %td - = link_to 'Remove from organization admin', - unassign_org_admins_admin_organization_path(organization.id, - role.name, - user: {email: user.email}), - method: :delete, - class: 'btn btn-danger' -- else - %h5 No users found! diff --git a/app/views/admin/organizations/edit.html.haml b/app/views/admin/organizations/edit.html.haml deleted file mode 100644 index c9d69bcd4..000000000 --- a/app/views/admin/organizations/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.row - .col-md-12 - .page-header - %h1 - Edit Organization - = @organization.name -.row - .col-md-8 - = render partial: 'form' diff --git a/app/views/admin/organizations/index.html.haml b/app/views/admin/organizations/index.html.haml deleted file mode 100644 index 09cf187ea..000000000 --- a/app/views/admin/organizations/index.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -.row - .col-md-12 - .page-header - %h1 Organizations - - if can? :manage, :all - .btn-group.pull-right - = link_to 'Create Organization', new_admin_organization_path, class: 'btn btn-success pull-right' - %p.text-muted - Manage organizations in OSEM -.row - .col-md-12 - %table.datatable - %thead - %tr - %th Name - %th Upcoming Conferences - %th Past Conferences - %th Code of Conduct? - %th Actions - %tbody - - @organizations.each do |organization| - %tr{ id: "organization-#{organization.id}" } - %td - = organization.name - %td - = organization.conferences.upcoming.count - %td - = organization.conferences.past.count - %td.text-center - - unless organization.code_of_conduct.blank? - = icon 'fa-solid', 'check', title: 'yes' - %td - .btn-group - = link_to 'Admins', admins_admin_organization_path(organization), - method: :get, class: 'btn btn-success' - = link_to 'Edit', edit_admin_organization_path(organization), - method: :get, class: 'btn btn-primary' - = link_to 'Delete', admin_organization_path(organization), - method: :delete, class: 'btn btn-danger', data: { confirm: "Warning: This will delete #{organization.name} and all its data which includes data for all conferences within #{organization.name}. Do you really want to continue?" } - = link_to 'Add Conference', new_admin_conference_path, method: :get, class: 'btn btn-info' diff --git a/app/views/admin/organizations/new.html.haml b/app/views/admin/organizations/new.html.haml deleted file mode 100644 index b38ea9372..000000000 --- a/app/views/admin/organizations/new.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.row - .col-md-12 - .page-header - %h1 - Create Organization -.row - .col-md-8 - = render partial: 'form' diff --git a/app/views/admin/organizations/show_org_admins.haml b/app/views/admin/organizations/show_org_admins.haml deleted file mode 100644 index 5c7698db1..000000000 --- a/app/views/admin/organizations/show_org_admins.haml +++ /dev/null @@ -1,20 +0,0 @@ -.row - .col-md-12 - .page-header - %h2 - Organization admins for #{@organization.name} - .text-muted - = @role.description - -.row.col-md-3 - - if ( can? :assign_org_admins, @organization ) - = form_for :user, url: assign_org_admins_admin_organization_path(@organization, @role.name), method: :post do |f| - .form-group - = f.label :email, 'Add user by email: ' - = f.text_field :email, placeholder: "User's email", class: 'form-control', required: true - = f.submit 'Add', id: 'user-add', class: 'btn btn-primary' - -.row - .col-md-12 - = render partial: 'users_with_org_admin_role', - locals: { users: @users, organization: @organization, role: @role } diff --git a/app/views/admin/programs/_form.html.haml b/app/views/admin/programs/_form.html.haml index c341dbbe3..ad85199b1 100644 --- a/app/views/admin/programs/_form.html.haml +++ b/app/views/admin/programs/_form.html.haml @@ -25,10 +25,9 @@ For the feature to work you need to set the voting dates below as well .form-group = f.label :voting_start_date - = f.text_field :voting_start_date, id: 'datetimepicker-voting_start_date', value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?), class: 'form-control' - .form-group + = f.datetime_field :voting_start_date, value: (f.object.voting_start_date.to_formatted_s(:db_without_seconds) unless f.object.voting_start_date.nil?), class: 'form-control' = f.label :voting_end_date - = f.text_field :voting_end_date, id: 'datetimepicker-voting_end_date', value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?), class: 'form-control' + = f.datetime_field :voting_end_date, value: (f.object.voting_end_date.to_formatted_s(:db_without_seconds) unless f.object.voting_end_date.nil?), class: 'form-control' %h4 Languages %hr diff --git a/app/views/admin/registration_periods/_form.html.haml b/app/views/admin/registration_periods/_form.html.haml index 35b996b10..36beb53cd 100644 --- a/app/views/admin/registration_periods/_form.html.haml +++ b/app/views/admin/registration_periods/_form.html.haml @@ -1,11 +1,20 @@ +%p + Setup the time frame in which people can registrer to your conference = form_for(@registration_period, url: admin_conference_registration_period_path(@conference.short_title)) do |f| .form-group = f.label :start_date %abbr{title: 'This field is required'} * - = f.text_field :start_date, required: true, 'data-end-conference': @conference.end_date.to_s, id: 'registration-period-start-datepicker', class: 'form-control' + %p.small + Must be before conference end (#{@conference.end_date}) and the end date + - if @registration_period.end_date + (#{@registration_period.end_date}) + below + = f.date_field :start_date, required: true, class: 'form-control', max: @conference.end_date .form-group = f.label :end_date %abbr{title: 'This field is required'} * - = f.text_field :end_date, required: true, id: 'registration-period-end-datepicker', class: 'form-control' + %p.small + Must be before conference end (#{@conference.end_date}) + = f.date_field :end_date, required: true, class: 'form-control', max: @conference.end_date %p.text-right = f.submit 'Save Registration Period', class: 'btn btn-primary' diff --git a/app/views/admin/registrations/index.xlsx.axlsx b/app/views/admin/registrations/index.xlsx.axlsx index d9cf24940..055102a39 100644 --- a/app/views/admin/registrations/index.xlsx.axlsx +++ b/app/views/admin/registrations/index.xlsx.axlsx @@ -3,7 +3,7 @@ wb = xlsx_package.workbook wb.add_worksheet(name: 'registrations') do |sheet| bold_style = wb.styles.add_style(b: true) - row = %w[Attended Name Nickname Affilιation Email] + row = ['Attended', 'Name', 'Nickname', 'Affilιation', 'Email', 'Ticket Token'] @conference.questions.each do |question| row << question.title @@ -18,6 +18,7 @@ wb.add_worksheet(name: 'registrations') do |sheet| row << registration.nickname row << registration.affiliation row << registration.email + row << registration.user.physical_tickets.by_conference(@conference).first&.token @conference.questions.each do |question| qa = registration.qanswers.find_by(question: question) answer = (qa ? qa.answer.title : '') diff --git a/app/views/admin/survey_questions/_form.html.haml b/app/views/admin/survey_questions/_form.html.haml index b77bb1c55..7b8885edb 100644 --- a/app/views/admin/survey_questions/_form.html.haml +++ b/app/views/admin/survey_questions/_form.html.haml @@ -86,10 +86,10 @@ .kinds.text{ class: @survey_question.text? ? '' : 'hidden' } %textarea.form-control{ rows: 4 } .kinds.datetime{ class: @survey_question.datetime? ? '' : 'hidden' } - .form-group{ class: 'datetimepicker' } + .form-group .input-group .input-group-addon %span.fa-solid.fa-calendar - %input.form-control{ readonly: 'readonly' } + %input.form-control{ type: 'datetime-local', readonly: 'readonly' } .kinds.numeric{ class: @survey_question.numeric? ? '' : 'hidden' } %input.form-control{ type: 'number' } diff --git a/app/views/admin/surveys/_form.html.haml b/app/views/admin/surveys/_form.html.haml index b03022ab1..3479bbc78 100644 --- a/app/views/admin/surveys/_form.html.haml +++ b/app/views/admin/surveys/_form.html.haml @@ -22,7 +22,7 @@ = f.select :target, Survey.targets.keys, class: 'form-control' .form-group = f.label :start_date - = f.text_field :start_date, class: 'datetimepicker form-control' + = f.datetime_field :start_date, class: 'form-control' = f.label :end_date - = f.text_field :end_date, class: 'datetimepicker form-control' + = f.datetime_field :end_date, class: 'form-control' = f.submit nil, class: 'btn btn-primary' diff --git a/app/views/admin/surveys/_survey_question.html.haml b/app/views/admin/surveys/_survey_question.html.haml index f006036e0..0219ce461 100644 --- a/app/views/admin/surveys/_survey_question.html.haml +++ b/app/views/admin/surveys/_survey_question.html.haml @@ -32,10 +32,10 @@ - elsif survey_question.text? = text_area_tag "survey_submission[#{survey_question.id}][]", survey_reply.text, rows: 4, class: 'form-control', required: survey_question.mandatory - elsif survey_question.datetime? - .form-group{ class: 'datetimepicker' } + .form-group .input-group .input-group-addon %span.fa-solid.fa-calendar - %input.form-control{ readonly: 'readonly', name: "survey_submission[#{survey_question.id}][]", value: survey_reply.text, required: survey_question.mandatory } + %input.form-control{ type: 'datetime-local', readonly: 'readonly', name: "survey_submission[#{survey_question.id}][]", value: survey_reply.text, required: survey_question.mandatory } - elsif survey_question.numeric? %input.form-control{ type: 'number', name: "survey_submission[#{survey_question.id}][]", value: survey_reply.text, required: survey_question.mandatory } diff --git a/app/views/admin/versions/_object_desc_and_link.html.haml b/app/views/admin/versions/_object_desc_and_link.html.haml index 6870af950..5291208d0 100644 --- a/app/views/admin/versions/_object_desc_and_link.html.haml +++ b/app/views/admin/versions/_object_desc_and_link.html.haml @@ -7,22 +7,13 @@ end - case version.item_type -- when 'Organization' - organization - = link_to_organization(version.item_id) - - when 'UsersRole' - role = current_or_last_object_state('Role', object.role_id) - role_name = role.try(:name) || PaperTrail::Version.where(item_type: 'Role', item_id: object.role_id).last.changeset[:name].second role - - if version.conference_id - - conference = Conference.find_by(id: version.conference_id) - - conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' ' - = link_if_alive version, role.try(:name), admin_conference_role_path(conference_short_title,role.try(:name) || ' '), conference - - elsif version.organization_id - - organization = Organization.find(version.organization_id) - = link_if_alive version, role_name, - admins_admin_organization_path(organization), organization + - conference = Conference.find_by(id: version.conference_id) + - conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' ' + = link_if_alive version, role.try(:name), admin_conference_role_path(conference_short_title,role.try(:name) || ' '), conference = version.event == 'create' ? 'to' : 'from' user @@ -130,15 +121,10 @@ - when 'Role' role - role_name = object.try(:name) || PaperTrail::Version.where(item_type: 'Role', item_id: version.item_id).last.changeset[:name].second - - if version.conference_id - - conference = Conference.find_by(id: version.conference_id) - - conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' ' - = link_if_alive version, role_name, - admin_conference_role_path(conference_short_title, role_name), conference - - elsif version.organization_id - - organization = Organization.find(version.organization_id) - = link_if_alive version, role_name, - admins_admin_organization_path(organization), organization + - conference = Conference.find_by(id: version.conference_id) + - conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' ' + = link_if_alive version, role_name, + admin_conference_role_path(conference_short_title, role_name), conference - when 'Venue' venue @@ -195,17 +181,13 @@ user = link_to_user(version.item_id) -- unless %w(Conference Subscription Registration User Organization).include?(version.item_type) +- unless %w(Conference Subscription Registration User).include?(version.item_type) - if version.item_type == 'Commercial' - commercial = current_or_last_object_state(version.item_type, version.item_id) - commercialable = current_or_last_object_state(commercial.commercialable_type, commercial.commercialable_id) - unless commercial.commercialable_type == 'Conference' in conference = link_to_conference(version.conference_id) - - elsif version.organization_id - - organization = Organization.find(version.organization_id) - in organization - = link_to_organization(version.organization_id) - else in conference = link_to_conference(version.conference_id) diff --git a/app/views/conference_registrations/_registration_info.html.haml b/app/views/conference_registrations/_registration_info.html.haml index a952c067c..a0a6a8cb6 100644 --- a/app/views/conference_registrations/_registration_info.html.haml +++ b/app/views/conference_registrations/_registration_info.html.haml @@ -1,16 +1,17 @@ -- unless @conference.code_of_conduct.blank? - - code_of_conduct_link = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} +- if @conference.code_of_conduct.present? + %h4 + Code of Conduct for + = @conference.short_title + = markdown @conference.code_of_conduct - if @registration.accepted_code_of_conduct = icon 'fa-solid', 'square-check' - I have read and accepted the - = code_of_conduct_link + I have read and accepted the Code of Conduct - else .checkbox %label = f.check_box :accepted_code_of_conduct, required: true I have read and accept the - = code_of_conduct_link + = link_to "Code of Conduct", code_of_conduct_conference_path(@conference.short_title) %abbr{title: 'This field is required'} * - if @conference.program.events.with_registration_open.any? || @registration.events.any? @@ -31,5 +32,3 @@ - if event.scheduled? (Scheduled on: #{event.time.to_date}) %br - -= render 'conferences/code_of_conduct', organization: @conference.organization diff --git a/app/views/conference_registrations/_total_purchased_tmp.haml b/app/views/conference_registrations/_total_purchased_tmp.haml new file mode 100644 index 000000000..fb3796a48 --- /dev/null +++ b/app/views/conference_registrations/_total_purchased_tmp.haml @@ -0,0 +1,45 @@ +------------ SnapCon: +.col-md-12 + - @total_price_per_currency.each do |currency, total_price| + %h4 + Total Purchased (#{currency}): + = humanized_money_with_symbol(total_price) + %ul + - @total_price_per_ticket_per_currency.select { |(id, curr)| curr == currency }.each do |(ticket_id, curr), total_amount| + - purchase = @purchases.find { |p| p.ticket_id == ticket_id && p.currency == curr } + %li + - title = purchase.title.titleize.gsub(/(?i)\bticket\b/, 'Tickets') + - title = title.include?('Tickets') ? title : "#{title} Tickets" + = "#{@total_quantity[[ticket_id, currency]]} #{title} for " + = humanized_money_with_symbol(total_amount) + .btn-group{ role: 'group' } + = link_to 'View all tickets', + conference_physical_tickets_path(@conference.short_title), + class: 'btn btn-success' + = link_to 'Get more tickets', + conference_tickets_path(@conference.short_title), + class: 'btn btn-default' + + + +----------- OSEM: +Total Purchased: += "(#{@tickets.first.price.symbol}#{humanized_money @total_price})" +%ul + .col-md-12 + - @ticket_payments.each_pair do |ticket_id, tickets| + %li + = @total_quantity[ticket_id] + = tickets.first.title + = pluralize(@total_quantity[ticket_id], 'Ticket') + for + = tickets.first.price.symbol + = humanized_money @total_price_per_ticket[ticket_id] + %br +.btn-group{ role: 'group' } + = link_to 'View all tickets', + conference_physical_tickets_path(@conference.short_title), + class: 'btn btn-success' + = link_to 'Get more tickets', + conference_tickets_path(@conference.short_title), + class: 'btn btn-default' diff --git a/app/views/conference_registrations/show.html.haml b/app/views/conference_registrations/show.html.haml index 88e4fac45..cedbf9829 100644 --- a/app/views/conference_registrations/show.html.haml +++ b/app/views/conference_registrations/show.html.haml @@ -21,24 +21,20 @@ .fa-stack .fa-solid.fa-square-dashed .fa-solid.fa-handshake - Code of Conduct + = link_to code_of_conduct_conference_path(@conference.short_title) do + Code of Conduct %ul.fa-ul - if @registration.accepted_code_of_conduct %li.text-info %span.fa-li = icon('fa-solid', 'check') - You have accepted the - = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} + You have accepted the Code of Conduct - else %li.text-warning %span.fa-li = icon('fa-solid', 'circle-exclamation') - You need to accept the - = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} - = render 'conferences/code_of_conduct', - organization: @conference.organization + You need to accept the Code of Conduct. Please + = link_to 'edit your Registration.', edit_conference_conference_registration_path(@conference.short_title), disabled: @conference.end_date < Date.today - if @conference.surveys.for_registration.any? .row .col-md-12 @@ -149,7 +145,7 @@ %i.fa-solid.fa-user-group.fa-stack-1x = @conference.participants.count Registered - = word_pluralize(@conference.participants.count, 'Attendee') + = pluralize(@conference.participants.count, 'Attendee') - @conference.participants.each do |participant| = link_to image_tag(participant.profile_picture(size: '25'), title: "#{participant.name}!", class: 'img-circle'), user_path(participant) .col-md-4.col-md-offset-2 @@ -160,6 +156,6 @@ %i.fa-solid.fa-microphone.fa-stack-1x = @conference.program.speakers.confirmed.count Confirmed - = word_pluralize(@conference.program.speakers.confirmed.count, 'Speaker') + = pluralize(@conference.program.speakers.confirmed.count, 'Speaker') - @conference.program.speakers.confirmed.each do |speaker| = link_to image_tag(speaker.profile_picture(size: '25'), title: "#{speaker.name}!", class: 'img-circle'), user_path(speaker) diff --git a/app/views/conferences/_code_of_conduct.haml b/app/views/conferences/_code_of_conduct.haml deleted file mode 100644 index 1b9b98674..000000000 --- a/app/views/conferences/_code_of_conduct.haml +++ /dev/null @@ -1,20 +0,0 @@ -= content_for :splash_nav do - %li - = link_to 'Code of Conduct', '#', - data: { toggle: 'modal', target: '#modal-code-of-conduct'} - -- content_for :modals do - - cache [organization, '#CoC-modal'] do - .modal.fade{ id: "modal-code-of-conduct" } - .modal-dialog - .modal-content - .modal-header - %button.close{ data: { dismiss: 'modal' } } - %i.fa-solid.fa-xmark - %h3.modal-title Code of Conduct - .modal-body - = markdown organization.code_of_conduct - .modal-footer - = link_to 'permalink', - [:code_of_conduct, organization], - target: '_blank' diff --git a/app/views/conferences/_conference_details.html.haml b/app/views/conferences/_conference_details.html.haml index b860d609a..e388b9a07 100644 --- a/app/views/conferences/_conference_details.html.haml +++ b/app/views/conferences/_conference_details.html.haml @@ -28,10 +28,8 @@ = link_to "View Conference", conference_path(conference.short_title), class: 'btn btn-default' - if conference.program and conference.program.schedule_public = link_to "Schedule", vertical_schedule_conference_schedule_path(conference.short_title), class: 'btn btn-default' - - unless conference.code_of_conduct.blank? - = link_to "Code of Conduct", - [:code_of_conduct, conference.organization], - class: 'btn btn-default' + - if conference.code_of_conduct.present? + = link_to "Code of Conduct", code_of_conduct_conference_path(conference.short_title), class: 'btn btn-default' - if conference.registration_open? - if conference.user_registered?(current_user) = link_to "My Registration", conference_conference_registration_path(conference.short_title), class: 'btn btn-default' @@ -59,4 +57,5 @@ - if current_user && current_user.physical_tickets.by_conference(conference).any? = link_to 'My Tickets', conference_physical_tickets_path(conference.short_title), class: 'btn btn-default' - surveys_after_conference = conference.surveys.after_conference.select(&:active?) - = link_to 'Surveys', conference_surveys_path(conference.short_title), class: 'btn btn-default' if surveys_after_conference.any? && conference.ended? + - if surveys_after_conference.any? && conference.ended? + = link_to 'Surveys', conference_surveys_path(conference.short_title), class: 'btn btn-default' diff --git a/app/views/conferences/_social_media.haml b/app/views/conferences/_social_media.haml index 4cfd4d2e0..2a257a208 100644 --- a/app/views/conferences/_social_media.haml +++ b/app/views/conferences/_social_media.haml @@ -28,3 +28,9 @@ = mail_to "#{ contact.email }" do %i.fa-solid.fa-envelope.fa-4x .trapezoid.social-media + -# .row + -# .col-md-12 + -# - if @conference.code_of_conduct.present? + -# %hr + -# %p.text-center + -# = link_to "Code of Conduct", code_of_conduct_conference_path(@conference.short_title) diff --git a/app/views/conferences/code_of_conduct.html.haml b/app/views/conferences/code_of_conduct.html.haml new file mode 100644 index 000000000..57f27cf74 --- /dev/null +++ b/app/views/conferences/code_of_conduct.html.haml @@ -0,0 +1,10 @@ +.container + .row + .col-md-12 + .page-header + %h1 + = @conference.short_title + Code Of Conduct + .row + .col-md-12 + = markdown @conference.code_of_conduct diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 49aa07b7e..48e826ea5 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -40,7 +40,7 @@ #splash -# - cache [@conference, @splashpage, @conference.program, current_user, '#splash#main'] do - if @conference.code_of_conduct.present? - = render 'code_of_conduct', organization: @conference.organization + = render 'code_of_conduct' -# header = render 'header', conference: @conference, venue: @conference.venue, splashpage: @splashpage, cached: true diff --git a/app/views/devise/ichain_sessions/new.html.haml b/app/views/devise/ichain_sessions/new.html.haml index 1d0a25eed..211bc9cae 100644 --- a/app/views/devise/ichain_sessions/new.html.haml +++ b/app/views/devise/ichain_sessions/new.html.haml @@ -6,7 +6,7 @@ %h3.panel-title Sign in .panel-body - = form_for(@login_url, method: :post, enctype: 'application/x-www-form-urlencoded', id: 'session' do |f| + = form_for(@login_url, method: :post, enctype: 'application/x-www-form-urlencoded', id: 'session') do |f| = f.hidden_field :url, value: @back_url = f.hidden_field :context, value: @context = f.hidden_field :proxypath, value: @proxypath diff --git a/app/views/layouts/_admin_sidebar_index.html.haml b/app/views/layouts/_admin_sidebar_index.html.haml index 91001405c..3da79dd2b 100644 --- a/app/views/layouts/_admin_sidebar_index.html.haml +++ b/app/views/layouts/_admin_sidebar_index.html.haml @@ -27,18 +27,8 @@ = link_to(admin_users_path) do %span.fa-solid.fa-user Users - - if can? :index, Organization - %li - = link_to(admin_organizations_path) do - %span.fa-solid.fa-users - Organizations - if can? :index, PaperTrail::Version %li = link_to(admin_revision_history_path) do %span.fa-solid.fa-clock-rotate-left Revision History - - if ENV.fetch('ORGANIZATIONS_ENABLED', nil) == 'true' - %li - = link_to(admin_organizations_path) do - %span.fa-solid.fa-user-group - Organizations diff --git a/app/views/layouts/_snapcon_nav.haml b/app/views/layouts/_snapcon_nav.haml index 82dc820ed..12208230b 100644 --- a/app/views/layouts/_snapcon_nav.haml +++ b/app/views/layouts/_snapcon_nav.haml @@ -9,8 +9,9 @@ All Events %b.caret %ul.dropdown-menu + -# TODO-SNAPCON: rename/redo org grouping. - visible_conference_links.each_with_index do |(org, confs), index| - %li.dropdown-header= org.name + %li.dropdown-header= org - confs.sort_by(&:start_date).each do |conf| %li= link_to(conf.title, conference_path(conf.short_title)) - if index < visible_conference_links.length - 1 diff --git a/app/views/layouts/_user_menu.html.haml b/app/views/layouts/_user_menu.html.haml index 887eee03a..f3c965adf 100644 --- a/app/views/layouts/_user_menu.html.haml +++ b/app/views/layouts/_user_menu.html.haml @@ -76,8 +76,3 @@ = link_to(admin_revision_history_path) do %span.fa-solid.fa-clock-rotate-left Revision History - - if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true' - %li - = link_to(admin_organizations_path) do - %span.fa-solid.fa-user-group - Organizations diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 64374c3f4..b225496b0 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -34,12 +34,12 @@ #messages .container = render 'layouts/messages' - #content + %main#content = yield = yield :modals - #footer + %footer#footer .container %p.muted.text-center %small @@ -50,8 +50,5 @@ You can run, copy, distribute, study, change and improve it. The source code and the developers are on #{link_to "GitHub", "https://github.com/snap-cloud/snapcon"}. This site is a modification of #{link_to "OSEM", "https://github.com/openSUSE/osem"}. - - if ENV.fetch('SKYLIGHT_PUBLIC_DASHBOARD_URL', nil) - Performance data is available on - #{link_to "Skylight", ENV["SKYLIGHT_PUBLIC_DASHBOARD_URL"]}. = yield :script_body = yield :charts_js diff --git a/app/views/organizations/index.html.haml b/app/views/organizations/index.html.haml deleted file mode 100644 index bd97ac2b3..000000000 --- a/app/views/organizations/index.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -.container - .row - .col-md-12.page-header - %h1 - Organizations - .btn-group.pull-right - / = link_to 'Add new', new_organization_path, class: 'btn btn-mini btn-success' - - @organizations.each do |organization| - .col-md-4{ id: "organization-#{organization.id}" } - .thumbnail - = image_tag(organization.picture.thumb.url, width: '20%') if organization.picture? - .caption - %h4 - = organization.name - .btn-group - = link_to 'Conferences', - conferences_organization_path(organization), - class: 'btn btn-success' - - unless organization.code_of_conduct.blank? - = link_to 'Code of Conduct', [:code_of_conduct, organization], class: 'btn btn-info' - / = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default' diff --git a/app/views/payments/_payment.html.haml b/app/views/payments/_payment.html.haml index 76544211e..c5c688ed6 100644 --- a/app/views/payments/_payment.html.haml +++ b/app/views/payments/_payment.html.haml @@ -26,6 +26,6 @@ currency: @currency, name: ENV.fetch('OSEM_NAME', 'OSEM'), description: "#{@conference.title} tickets", - key: ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key, + key: ENV.fetch('STRIPE_PUBLISHABLE_KEY'), locale: "auto"}} = link_to 'Edit Purchase', conference_tickets_path(@conference.short_title), class: 'btn btn-default' diff --git a/app/views/physical_tickets/show.html.haml b/app/views/physical_tickets/show.html.haml index ec8e73793..693517456 100644 --- a/app/views/physical_tickets/show.html.haml +++ b/app/views/physical_tickets/show.html.haml @@ -34,12 +34,6 @@ = image_tag(@conference.picture.ticket.url, class: 'img-responsive') - else = image_tag('/img/osem-logo.png', class: 'img-responsive') - %p.text-left - %br - %strong - Organization - %br - = @conference.organization.name .col-md-5.box.well %p.text-left %strong diff --git a/app/views/proposals/_form.html.haml b/app/views/proposals/_form.html.haml index 150083d4c..d116d08a7 100644 --- a/app/views/proposals/_form.html.haml +++ b/app/views/proposals/_form.html.haml @@ -1,3 +1,9 @@ +:ruby + action_is_edit = @event.persisted? + user_is_admin = current_user&.is_admin? + display_details = user_is_admin || action_is_edit + display_registration = user_is_admin || @program.cfp&.enable_registrations? + %h4 Proposal Information %hr @@ -57,7 +63,8 @@ - if @program.languages.present? .form-group = f.label :language - = f.select :language, @languages, { include_blank: false}, { class: 'select-help-toggle form-control' } + = f.select :language, @program.languages_list, { include_blank: false}, { class: 'select-help-toggle form-control' } + - if @conference.program.difficulty_levels.any? .form-group @@ -96,3 +103,55 @@ %p.text-right = f.submit @event.persisted? ? 'Update Proposal' : 'Create Proposal', class: 'btn btn-success' + +- content_for :script_head do + :javascript + /* Wait for the DOM to be ready before attaching events to the elements */ + $( document ).ready(function() { + /* Set the minimum and maximum proposal abstract word length */ + function updateEventTypeRequirements() { + var $selected = $("#event_event_type_id option:selected") + var max = $selected.data("max-words"); + var min = $selected.data("min-words"); + + // We replace the default text only if the current field is empty, + // or is set to the default text of another event type. + replace_defaut_submission_text( + '#event_submission_text', + $selected.data("instructions"), + $("#event_event_type_id option").toArray().map(e => $(e).data('instructions')) + ); + + $("#abstract-maximum-word-count").text(max); + $("#abstract-minimum-word-count").text(min); + word_count($('#event_abstract').get(0), 'abstract-count', max); + } + $("#event_event_type_id").change(updateEventTypeRequirements); + updateEventTypeRequirements(); + + /* Count the proposal abstract length */ + $("#event_abstract").on('input', function() { + var $selected = $("#event_event_type_id option:selected") + var max = $selected.data("max-words"); + word_count(this, 'abstract-count', max); + } ); + + /* Count the submission text length */ + $("#event_submission_text").bind('change keyup paste input', function() { + var $selected = $("event_event_type_id option:selected") + var max = $selected.data("max-words"); + word_count(this, 'submission-count', max); + }); + + $('.js-resetSubmissionText').click((e) => { + console.log('CLICKED') + let $selected = $("#event_event_type_id option:selected"); + let $this = $(e.target); + let affirm = confirm($this.data('confirm')); + if (affirm) { + let sub_text = $('#event_submission_text'); + sub_text.val($selected.data('instructions')); + sub_text.trigger('change'); + } + }); + }); diff --git a/app/views/schedules/show.xml.haml b/app/views/schedules/show.xml.haml index 21bbbcea4..68cdce7c5 100644 --- a/app/views/schedules/show.xml.haml +++ b/app/views/schedules/show.xml.haml @@ -16,12 +16,13 @@ %room{ name: room.name } - events_in_rooms[room].each do |event| %event{ guid: event.guid, id: event.id } - %date= event.time.in_time_zone(@conference.timezone).iso8601 + %date= event.time.change(zone: @conference.timezone).iso8601 %start= event.time.strftime('%H:%M') %duration= length_timestamp(event.event_type.length) %room= event.room.name %type= event.event_type.name - %language= ISO_639.find_by_english_name(event.language).third if event.language + - if event.language && ISO_639.find_by_english_name(event.language) + %language= ISO_639.find_by_english_name(event.language).third %slug= "#{event.id} #{event.title}".parameterize %title= event.title %subtitle= event.subtitle diff --git a/app/views/tracks/_form_fields.html.haml b/app/views/tracks/_form_fields.html.haml index b32420996..4c2210209 100644 --- a/app/views/tracks/_form_fields.html.haml +++ b/app/views/tracks/_form_fields.html.haml @@ -13,12 +13,12 @@ = f.color_field :color, size: 6, required: true, class: 'form-control' .form-group = f.label :start_date, "Start Date" - = f.text_field :start_date, id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' + = f.date_field :start_date, required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' - if @track.self_organized_and_accepted_or_confirmed? %abbr{title: 'This field is required'} * .form-group = f.label :end_date, "End Date" - = f.text_field :end_date, id: 'registration-period-end-datepicker', required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' + = f.date_field :end_date, required: @track.self_organized_and_accepted_or_confirmed?, class: 'form-control' - if @track.self_organized_and_accepted_or_confirmed? %abbr{title: 'This field is required'} * - if current_user.is_admin? diff --git a/config/amazon-rds-ca-cert.pem b/config/amazon-rds-ca-cert.pem deleted file mode 100644 index 864a818dd..000000000 --- a/config/amazon-rds-ca-cert.pem +++ /dev/null @@ -1,720 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT -MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK -DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT -MSUwIwYDVQQDDBxBbWF6b24gUkRTIGFwLWVhc3QtMSBSb290IENBMB4XDTE5MDIx -NzAyNDcwMFoXDTIyMDYwMTEyMDAwMFowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQI -DApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMSIwIAYDVQQKDBlBbWF6b24g -V2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSAwHgYDVQQD -DBdBbWF6b24gUkRTIGFwLWVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAOcJAUofyJuBuPr5ISHi/Ha5ed8h3eGdzn4MBp6rytPOg9NVGRQs -O93fNGCIKsUT6gPuk+1f1ncMTV8Y0Fdf4aqGWme+Khm3ZOP3V1IiGnVq0U2xiOmn -SQ4Q7Loe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7laiLwTNsaro5qsqErD5uXuot6o9beT -a+GiKinEur35tNxAr47ax4IRubuIzyfCrezjfKc5raVV2NURJDyKP0m0CCaffAxE -qn2dNfYc3v1D8ypg3XjHlOzRo32RB04o8ALHMD9LSwsYDLpMag== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEEDCCAvigAwIBAgIJAKFMXyltvuRdMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD -VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi -MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h -em9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJEUyBCZXRhIFJvb3QgMjAxOSBDQTAe -Fw0xOTA4MTkxNzM4MjZaFw0yNDA4MTkxNzM4MjZaMIGUMQswCQYDVQQGEwJVUzEQ -MA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UECgwZ -QW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEl -MCMGA1UEAwwcQW1hem9uIFJEUyBCZXRhIFJvb3QgMjAxOSBDQTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMkZdnIH9ndatGAcFo+DppGJ1HUt4x+zeO+0 -ZZ29m0sfGetVulmTlv2d5b66e+QXZFWpcPQMouSxxYTW08TbrQiZngKr40JNXftA -atvzBqIImD4II0ZX5UEVj2h98qe/ypW5xaDN7fEa5e8FkYB1TEemPaWIbNXqchcL -tV7IJPr3Cd7Z5gZJlmujIVDPpMuSiNaal9/6nT9oqN+JSM1fx5SzrU5ssg1Vp1vv -5Xab64uOg7wCJRB9R2GC9XD04odX6VcxUAGrZo6LR64ZSifupo3l+R5sVOc5i8NH -skdboTzU9H7+oSdqoAyhIU717PcqeDum23DYlPE2nGBWckE+eT8CAwEAAaNjMGE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config/application.rb index c65e46dd0..ede5cb39a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -63,6 +63,6 @@ class Application < Rails::Application # This is a nightmare with our current data model, no one ever thought about this. config.active_record.belongs_to_required_by_default = false # https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017 - config.active_record.yaml_column_permitted_classes = ['Date', 'DateTime', 'Symbol', 'Time'] + config.active_record.yaml_column_permitted_classes = [Date, DateTime, Symbol, Time, ActiveSupport::TimeWithZone, ActiveSupport::TimeZone] end end diff --git a/config/database.yml b/config/database.yml index 9609cd404..2190be13a 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,34 +1,20 @@ -<% - encoding = 'unicode' - if ENV.fetch('OSEM_DB_ADAPTER', nil) == 'mysql2' - encoding = 'utf8' - end -%> - - default: &default - adapter: <%= ENV.fetch('OSEM_DB_ADAPTER', 'postgresql') %> - encoding: <%= encoding %> - host: <%= ENV.fetch('OSEM_DB_HOST', 'database') %> + adapter: 'postgresql' + encoding: 'unicode' + host: <%= ENV.fetch('OSEM_DB_HOST', 'localhost') %> port: <%= ENV.fetch('OSEM_DB_PORT', '5432') %> username: <%= ENV.fetch('OSEM_DB_USER', ENV.fetch('USER', 'postgres')) %> password: <%= ENV.fetch('OSEM_DB_PASSWORD', 'mysecretpassword') %> database: <%= ENV.fetch('OSEM_DB_NAME', 'postgres') %> - pool: 30 - timeout: 60000 + pool: 5 + timeout: 5000 development: <<: *default - host: localhost - # username: <%= ENV['OSEM_DB_USER'] || 'postgres' %> database: osem_development -# Warning: The database defined as "test" will be erased and -# re-generated when you run "rake". -# Do not set this db to the same as development or production. test: <<: *default - host: localhost database: osem_test production: diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 20960f3e5..19630d1c7 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -7,26 +7,15 @@ # Pass each provider to User model in :omniauth_providers (for open_id providers use their name) config.omniauth :open_id, name: 'suse', identifier: 'http://www.opensuse.org/openid/user' - - config.omniauth :google_oauth2, - ENV.fetch('OSEM_GOOGLE_KEY', Rails.application.secrets.google_key), - ENV.fetch('OSEM_GOOGLE_SECRET', Rails.application.secrets.google_secret), - name: 'google', - scope: %w[email profile] + config.omniauth :google_oauth2, ENV.fetch('OSEM_GOOGLE_KEY', nil), ENV.fetch('OSEM_GOOGLE_SECRET', nil), name: 'google', scope: 'email' + config.omniauth :facebook, ENV.fetch('OSEM_FACEBOOK_KEY', nil), ENV.fetch('OSEM_FACEBOOK_SECRET', nil) + config.omniauth :github, ENV.fetch('OSEM_GITHUB_KEY', nil), ENV.fetch('OSEM_GITHUB_SECRET', nil) # TODO-SNAPCON: This ought to be configurable. Use OSEM_DISCOURSE_KEY? config.omniauth :discourse, sso_url: 'https://forum.snap.berkeley.edu/session/sso_provider', sso_secret: ENV.fetch('OSEM_DISCOURSE_SECRET', nil) - config.omniauth :facebook, - ENV.fetch('OSEM_FACEBOOK_KEY', Rails.application.secrets.facebook_key), - ENV.fetch('OSEM_FACEBOOK_SECRET', Rails.application.secrets.facebook_secret) - - config.omniauth :github, - ENV.fetch('OSEM_GITHUB_KEY', Rails.application.secrets.github_key), - ENV.fetch('OSEM_GITHUB_SECRET', Rails.application.secrets.github_secret) - # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class with default "from" parameter. diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index e8d8a1c88..b3869923b 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,6 +1,5 @@ Sentry.init do |config| - config.enabled_environments = %(production staging) - config.dsn = ENV.fetch('OSEM_SENTRY_DSN', Rails.application.secrets.sentry_dsn) + config.dsn = ENV.fetch('OSEM_SENTRY_DSN', nil) config.breadcrumbs_logger = [:active_support_logger] config.backtrace_cleanup_callback = lambda do |backtrace| diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb index 71ca5bf74..f40ad45d1 100644 --- a/config/initializers/stripe.rb +++ b/config/initializers/stripe.rb @@ -1 +1 @@ -Stripe.api_key = ENV.fetch('STRIPE_SECRET_KEY') { Rails.application.secrets.stripe_secret_key } +Stripe.api_key = ENV.fetch('STRIPE_SECRET_KEY', nil) diff --git a/config/routes.rb b/config/routes.rb index 62ac3dfdd..cbb29a2a8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,13 +25,6 @@ end namespace :admin do - resources :organizations do - member do - get :admins - post :assign_org_admins - delete :unassign_org_admins - end - end resources :users do member do patch :toggle_confirmation @@ -162,12 +155,8 @@ get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object' get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute' end - resources :organizations, only: [:index] do - member do - get :conferences, 'code-of-conduct' - end - end - resources :conferences, only: %i[index show] do + + resources :conferences, only: [:index, :show] do resources :booths do member do patch :withdraw @@ -224,6 +213,10 @@ resources :rooms, only: [] do get :live_session end + + member do + get 'code-of-conduct' + end end namespace :api, defaults: { format: 'json' } do diff --git a/config/secrets.yml.example b/config/secrets.yml.example deleted file mode 100644 index c0d92bbfd..000000000 --- a/config/secrets.yml.example +++ /dev/null @@ -1,73 +0,0 @@ -development: - # Generate your own with rake secret - # secret_key_base: '12345' - - ########## OMNIAUTH Providers ########## - # This is just sample data so mocks work - google_key: 'sample' - google_secret: 'sample' - - facebook_key: 'sample' - facebook_secret: 'sample' - - suse_key: 'sample' - suse_secret: 'sample' - - # Register on stripe and add TEST keys here - # https://dashboard.stripe.com/account/apikeys - stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %> - stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %> - -test: - # Generate your own with rake secret - # secret_key_base: '12345' - - # Register on stripe and add TEST keys here - # https://dashboard.stripe.com/account/apikeys - stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %> - stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %> - -production: - # Generate your own with rake secret or use the environment - # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> - - # Your sentry.io DSN key - # sentry_dsn: '12345' - - ########## OMNIAUTH Providers ########## - # Leave the variables' names empty, unless you use the providers, in which - # case you need to register your applicaton and add the actual keys. - # - # If you add a provider, keep the format of the variables: - # *provider*_key and *provider*_secret - - # If you add a provider that does not require a key, you still have to - # create the 2 variables with sample data or they won't show up in the app. - - # Register your appllication with Google from - # https://code.google.com/apis/console#:access - google_key: '' - google_secret: '' - - # Register your application with Facebook from - # https://developers.facebook.com/ - facebook_key: '' - facebook_secret: '' - - # Developers do not need to register their application for suse account to - # work. You must, however, add some sample value to the variables, for the - # login option to appear. For example: - #suse_key: 'sample data' - #suse_secret: 'sample data' - suse_key: '' - suse_secret: '' - - # Register your application with GitHub from - # https://github.com/settings/applications - github_key: '' - github_secret: '' - - # Register on stripe and add LIVE keys here - # https://dashboard.stripe.com/account/apikeys - stripe_publishable_key: <%= ENV['STRIPE_PUBLISHABLE_KEY'] %> - stripe_secret_key: <%= ENV['STRIPE_SECRET_KEY'] %> diff --git a/db/migrate/20140730104658_migrate_roles_for_cancancan.rb b/db/migrate/20140730104658_migrate_roles_for_cancancan.rb index 22372afb8..b3ae3400a 100644 --- a/db/migrate/20140730104658_migrate_roles_for_cancancan.rb +++ b/db/migrate/20140730104658_migrate_roles_for_cancancan.rb @@ -8,7 +8,7 @@ def up Role.all.each do |role| role.users.each do |user| Conference.all.each do |conference| - if role.name == 'Admin' || role.name == 'Organizer' + if ['Admin', 'Organizer'].include?(role.name) user.add_role :organizer, conference user.update_columns(is_admin: true) else diff --git a/db/migrate/20170531094819_move_conferences_to_organizations.rb b/db/migrate/20170531094819_move_conferences_to_organizations.rb index 7f7e776cb..01cfa87f9 100644 --- a/db/migrate/20170531094819_move_conferences_to_organizations.rb +++ b/db/migrate/20170531094819_move_conferences_to_organizations.rb @@ -13,7 +13,7 @@ def change add_reference :conferences, :organization, index: true TempConference.reset_column_information - if TempConference.count != 0 + if TempConference.any? organization = TempOrganization.create(name: 'organization', description: 'Default organization') TempConference.all.each do |conference| conference.organization_id = organization.id diff --git a/db/migrate/20181229233812_drop_organizations.rb b/db/migrate/20181229233812_drop_organizations.rb new file mode 100644 index 000000000..3a5d4cd53 --- /dev/null +++ b/db/migrate/20181229233812_drop_organizations.rb @@ -0,0 +1,11 @@ +class DropOrganizations < ActiveRecord::Migration[7.0] + def change + remove_reference :conferences, :organization, index: true + + drop_table :organizations do |t| + t.string :name, null: false + t.text :description + t.string :picture + end + end +end diff --git a/db/migrate/20181229233813_add_code_of_conduct_to_conference.rb b/db/migrate/20181229233813_add_code_of_conduct_to_conference.rb new file mode 100644 index 000000000..6151241f2 --- /dev/null +++ b/db/migrate/20181229233813_add_code_of_conduct_to_conference.rb @@ -0,0 +1,5 @@ +class AddCodeOfConductToConference < ActiveRecord::Migration[7.0] + def change + add_column :conferences, :code_of_conduct, :text + end +end diff --git a/db/migrate/20241121114727_change_comment_subject_limit.rb b/db/migrate/20241121114727_change_comment_subject_limit.rb new file mode 100644 index 000000000..ec4865e35 --- /dev/null +++ b/db/migrate/20241121114727_change_comment_subject_limit.rb @@ -0,0 +1,9 @@ +class ChangeCommentSubjectLimit < ActiveRecord::Migration[7.0] + def up + change_column :comments, :subject, :string, limit: 255 + end + + def down + raise ActiveRecord::IrreversibleMigration.new('Cannot reverse migration.') + end +end diff --git a/db/schema.rb b/db/schema.rb index 18d82ff98..835f86307 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_08_01_042356) do +ActiveRecord::Schema[7.0].define(version: 2024_11_21_114727) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -63,7 +63,7 @@ t.integer "user_id" t.datetime "created_at", precision: nil t.datetime "updated_at", precision: nil - t.string "subject" + t.string "subject", limit: 255 t.integer "parent_id" t.integer "lft" t.integer "rgt" @@ -104,13 +104,12 @@ t.string "picture" t.integer "start_hour", default: 9 t.integer "end_hour", default: 20 - t.integer "organization_id" t.integer "ticket_layout", default: 0 t.string "custom_domain" t.integer "booth_limit", default: 0 t.text "custom_css" + t.text "code_of_conduct" t.text "registered_attendees_message" - t.index ["organization_id"], name: "index_conferences_on_organization_id" end create_table "conferences_questions", id: false, force: :cascade do |t| @@ -315,13 +314,6 @@ t.datetime "updated_at", precision: nil end - create_table "organizations", force: :cascade do |t| - t.string "name", null: false - t.text "description" - t.string "picture" - t.text "code_of_conduct" - end - create_table "payments", force: :cascade do |t| t.string "last4" t.integer "amount" @@ -547,8 +539,8 @@ t.integer "payment_id" t.integer "week" t.float "amount_paid", default: 0.0 - t.string "currency" t.integer "amount_paid_cents", default: 0 + t.string "currency" end create_table "ticket_scannings", force: :cascade do |t| @@ -628,7 +620,7 @@ t.boolean "is_disabled", default: false t.string "picture" t.string "timezone" - t.string "default_currency" + t.text "default_currency" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true @@ -681,9 +673,7 @@ t.text "object_changes" t.datetime "created_at", precision: nil t.integer "conference_id" - t.bigint "organization_id" t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" - t.index ["organization_id"], name: "index_versions_on_organization_id" end create_table "votes", force: :cascade do |t| diff --git a/docker-compose.override.yml.example b/docker-compose.override.yml.example index 2d816375b..b33038070 100644 --- a/docker-compose.override.yml.example +++ b/docker-compose.override.yml.example @@ -1,5 +1,3 @@ -version: "2.4" - services: osem: build: diff --git a/docker-compose.yml b/docker-compose.yml index 70e5b94bb..c4b355df2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,6 @@ -version: "2.4" - services: database: - image: postgres:12-alpine + image: postgres:16-alpine environment: PGDATA: /var/lib/postgresql/data/pgdata POSTGRES_PASSWORD: $OSEM_DB_PASSWORD diff --git a/docker-compose.yml.production-example b/docker-compose.yml.production-example index c5de55b81..0d1c0ef7e 100644 --- a/docker-compose.yml.production-example +++ b/docker-compose.yml.production-example @@ -1,5 +1,3 @@ -version: "2.4" - services: production_database: image: postgres:12-alpine diff --git a/dotenv.example b/dotenv.example index 372800ec9..6d31d9c62 100644 --- a/dotenv.example +++ b/dotenv.example @@ -9,9 +9,6 @@ # bundle exec rake secret # SECRET_KEY_BASE=12345 -# The type of database to use (postgresql, mysql2, sqlite3) -# OSEM_DB_ADAPTER=mysql2 - # The name of the host the database runs on # OSEM_DB_HOST=database @@ -32,9 +29,6 @@ # OSEM_MEMCACHED_USERNAME='root' # OSEM_MEMCACHED_PASSWORD='1234' -# Set this if you want to deviate from our 'standard' ruby version -# OSEM_RUBY_VERSION=3.1.2 - # What time is it? # OSEM_TIME_ZONE="UTC" @@ -111,10 +105,6 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # FORCE_SSL=true -# Your skylight.io keys -# SKYLIGHT_AUTHENTICATION=1234 -# SKYLIGHT_PUBLIC_DASHBOARD_URL='https://oss.skylight.io/app/applications/xxxxxxxxxxxx' - # How should browser tests be performed? # For headless Chrome (default): # OSEM_TEST_DRIVER=chrome_headless diff --git a/lib/rails_version.rb b/lib/rails_version.rb deleted file mode 100644 index 813fed29c..000000000 --- a/lib/rails_version.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Check which Rails version is used by the application -# -# This allows code to be migrated to a newer version of Rails while keeping the old code around -# until the migration to the newer Rails version is done. -# -# Use this module in combination with the gem next_rails and its Gemfile.next/Gemfile.next.lock. -# -# Methods of this module must match whatever Rails version is defined in Gemfile.next.lock. -# Matching on major and minor versions should be enough for most migrations. -module RailsVersion - def self.is_6? - Rails::VERSION::MAJOR == 6 - end -end diff --git a/lib/tasks/data_demo.rake b/lib/tasks/data_demo.rake index 97c6e5115..93a02770e 100644 --- a/lib/tasks/data_demo.rake +++ b/lib/tasks/data_demo.rake @@ -5,8 +5,8 @@ namespace :data do task demo: :environment do include FactoryBot::Syntax::Methods - conference = create(:full_conference, title: 'Open Source Event Manager Demo', short_title: 'osemdemo', -description: "This is a [Open Source Event Manager](http://osem.io/) demo instance. You can log in as **admin** with the password **password123** or just you just [sign up](/accounts/sign_up) with your own user. We hope you enjoy checking out all the functionality, if you have questions don't hesitate to [contact us](http://osem.io/#contact)!\r\n\r\n## Data will be destroyed every thirty minutes or whenever someone updates the [OSEM source code on github](https://github.com/openSUSE/osem/commits/master).") + + conference = create(:full_conference, title: 'Open Source Event Manager Demo', short_title: 'osemdemo' ,description: "This is a [Open Source Event Manager](http://osem.io/) demo instance. You can log in as **admin** with the password **password123** or just you just [sign up](/accounts/sign_up) with your own user. We hope you enjoy checking out all the functionality, if you have questions don't hesitate to [contact us](http://osem.io/#contact)!\r\n\r\n## Data will be destroyed every thirty minutes or whenever someone updates the [OSEM source code on github](https://github.com/openSUSE/osem/commits/master).") conference.contact.update(email: 'osemdemo@osem.io', sponsor_email: 'osemdemo@osem.io') create(:admin, email: 'admin@osem.io', username: 'admin', password: 'password123', password_confirmation: 'password123') diff --git a/lib/tasks/dump_db.rake b/lib/tasks/dump_db.rake deleted file mode 100644 index 71b557f4e..000000000 --- a/lib/tasks/dump_db.rake +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require 'yaml' -task :dump_db do - yaml = YAML.load_file('config/database.yml') - conf = yaml['production'] - filename = "#{conf['database']}-#{Time.now.strftime('%Y-%m-%d-%H:%M:%S:%L')}.sql" - if conf['adapter'] == 'mysql2' - system "mysqldump -u #{conf['username']} --password=#{conf['password']} -h #{conf['host']} #{conf['database']} > ~/#{filename}" - else - puts 'Error: This rake task only works for MYSQL' - end -end diff --git a/lib/tasks/events_registrations.rake b/lib/tasks/events_registrations.rake index 5fef1d85d..fbcd2d443 100644 --- a/lib/tasks/events_registrations.rake +++ b/lib/tasks/events_registrations.rake @@ -7,19 +7,21 @@ namespace :events_registrations do duplicates = EventsRegistration.all.map { |er| er.id if er.valid? == false }.compact puts "Duplicates found: #{duplicates.count}" - puts "With IDs: #{duplicates}" if duplicates.count > 0 + if duplicates.any? + puts "With IDs: #{duplicates}" + end EventsRegistration.all.each do |er| records = EventsRegistration.where(registration_id: er.registration_id, event_id: er.event_id) - next unless records.count > 1 - - # Iterate through duplicates (excluding 1st record) - (1..(records.count - 1)).each do |i| - puts "Deleting EventsRegistration record with ID #{records[i].id} ..." - if records[i].destroy - puts 'Succeeded!' - else - puts 'Faild!' + if records.many? + # Iterate through duplicates (excluding 1st record) + (1..(records.count - 1)).each do |i| + puts "Deleting EventsRegistration record with ID #{records[i].id} ..." + if records[i].destroy + puts 'Succeeded!' + else + puts 'Faild!' + end end end end diff --git a/lib/tasks/roles.rake b/lib/tasks/roles.rake index e07122bc9..2b753c9fd 100644 --- a/lib/tasks/roles.rake +++ b/lib/tasks/roles.rake @@ -3,10 +3,6 @@ namespace :roles do desc 'Adds back deleted roles to all conferences' task add: :environment do - Organization.all.each do |org| - Role.where(name: 'organization_admin', - resource: org).first_or_create(description: 'For the administrators of an organization and its conferences') - end Conference.all.each do |c| Role.where(name: 'organizer', diff --git a/spec/ability/ability_spec.rb b/spec/ability/ability_spec.rb index abbd623f2..02874e123 100644 --- a/spec/ability/ability_spec.rb +++ b/spec/ability/ability_spec.rb @@ -6,12 +6,12 @@ describe 'User' do describe 'Abilities' do # see https://github.com/CanCanCommunity/cancancan/wiki/Testing-Abilities - subject(:ability) { Ability.new(user) } + subject(:ability){ Ability.new(user) } + let(:user){ nil } let!(:admin) { create(:admin) } let(:user) { nil } - let!(:organization) { create(:organization) } - let!(:my_conference) { create(:full_conference, organization: organization) } + let!(:my_conference) { create(:full_conference) } let(:my_room) { create(:room, venue: my_conference.venue) } let(:conference_not_public) { create(:conference, splashpage: create(:splashpage, public: false)) } let(:conference_public) { create(:full_conference, splashpage: create(:splashpage, public: true)) } @@ -30,8 +30,7 @@ # Test abilities for not signed in users context 'when user is not signed in' do - it { is_expected.to be_able_to(:index, Organization) } - it { is_expected.to be_able_to(:index, Conference) } + it{ should be_able_to(:index, Conference)} it { is_expected.to be_able_to(:show, conference_public) } it { is_expected.not_to be_able_to(:show, conference_not_public) } diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index c91bbacf9..24c001dde 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -4,18 +4,13 @@ describe Admin::ConferencesController do # It is necessary to use bang version of let to build roles before user - let!(:organization) { create(:organization, name: 'organization') } - let!(:conference) do - create(:conference, organization: organization, start_date: Date.new(2014, 5, 26), end_date: Date.new(2014, 5, 26) + 15) - end - let!(:organization_admin_role) { Role.find_by(name: 'organization_admin', resource: organization) } - let(:organization_admin) { create(:user, role_ids: organization_admin_role.id) } + let!(:conference) { create(:conference, end_date: Date.new(2014, 05, 26) + 15) } let(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) } let!(:organizer) { create(:organizer, resource: conference) } let!(:organizer2) { create(:organizer, email: 'organizer2@email.osem', resource: conference) } let(:participant) { create(:user) } - shared_examples 'access as organizer or organization_admin' do + shared_examples 'access as organizer' do describe 'PATCH #update' do context 'valid attributes' do it 'locates the requested conference' do @@ -207,99 +202,6 @@ end end - shared_examples 'access as organization_admin' do - describe 'POST #create' do - context 'with valid attributes' do - it 'saves the conference to the database' do - expected = expect do - post :create, params: { conference: - attributes_for(:conference, short_title: 'dps15', organization_id: organization.id) } - end - expected.to change { Conference.count }.by 1 - end - - it 'redirects to conference#show' do - post :create, params: { conference: - attributes_for(:conference, short_title: 'dps15', organization_id: organization.id) } - - expect(response).to redirect_to admin_conference_path( - assigns[:conference].short_title - ) - end - - it 'creates roles for the conference' do - cfp_role = Role.find_by(name: 'cfp', resource: conference) - info_desk_role = Role.find_by(name: 'info_desk', resource: conference) - volunteers_coordinator_role = Role.find_by(name: 'volunteers_coordinator', resource: conference) - - post :create, params: { conference: - attributes_for(:conference, short_title: 'dps15') } - - expect(conference.roles.count).to eq 4 - - expect(conference.roles).to match_array [organizer_role, cfp_role, info_desk_role, - volunteers_coordinator_role] - end - end - - context 'with invalid attributes' do - it 'does not save the conference to the database' do - expected = expect do - post :create, params: { conference: - attributes_for(:conference, short_title: nil, organization_id: organization.id) } - end - expected.not_to change { Conference.count } - end - - it 're-renders the new template' do - post :create, params: { conference: - attributes_for(:conference, short_title: nil, organization_id: organization.id) } - expect(response).to be_successful - end - end - - context 'with duplicate conference short title' do - it 'does not save the conference to the database' do - conference - expected = expect do - post :create, params: { conference: - attributes_for(:conference, short_title: conference.short_title, organization_id: organization.id) } - end - expected.not_to change { Conference.count } - end - - it 're-renders the new template' do - conference - post :create, - params: { conference: attributes_for(:conference, short_title: conference.short_title, - organization_id: organization.id) } - expect(response).to be_successful - end - end - end - - describe 'GET #new' do - it 'assigns a new conference to conference' do - get :new - expect(assigns(:conference)).to be_a_new(Conference) - end - - it 'renders the :new template' do - get :new - expect(response).to render_template :new - end - end - end - - describe 'organization admin access' do - before do - sign_in(organization_admin) - end - - it_behaves_like 'access as organizer or organization_admin' - it_behaves_like 'access as organization_admin' - end - shared_examples 'access as organizer, participant or guest' do |path, message| describe 'GET #new' do it 'requires organizer privileges' do @@ -311,8 +213,7 @@ describe 'POST #create' do it 'requires organizer privileges' do - post :create, params: { conference: attributes_for(:conference, - short_title: 'ExCon', organization_id: organization.id) } + post :create, params: { conference: attributes_for(:conference, short_title: 'ExCon') } expect(response).to redirect_to(send(path)) expect(flash[:alert]).to match(/#{message}/) if message end @@ -324,9 +225,8 @@ sign_in(organizer) end - it_behaves_like 'access as organizer or organization_admin' - it_behaves_like 'access as organizer, participant or guest', :root_path, - 'You are not authorized to access this page.' + it_behaves_like 'access as organizer' + it_behaves_like 'access as organizer, participant or guest', :root_path, 'You are not authorized to access this page.' end shared_examples 'access as participant or guest' do |path, message| diff --git a/spec/controllers/admin/organizations_controller_spec.rb b/spec/controllers/admin/organizations_controller_spec.rb deleted file mode 100644 index 5bddb571f..000000000 --- a/spec/controllers/admin/organizations_controller_spec.rb +++ /dev/null @@ -1,203 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe Admin::OrganizationsController do - let!(:admin) { create(:admin) } - let!(:organization) { create(:organization) } - let!(:user) { create(:user) } - - context 'logged in as user with no role' do - before do - sign_in user - end - - describe 'GET #new' do - before do - get :new - end - - it 'redirects to root' do - expect(flash[:alert]).to eq('You are not authorized to access this page.') - expect(response).to redirect_to(root_path) - end - end - - describe 'GET #index' do - before do - get :index - end - - it 'redirects to root' do - expect(flash[:alert]).to eq('You are not authorized to access this page.') - expect(response).to redirect_to(root_path) - end - end - - describe 'POST #create' do - it 'does not create new organization' do - expected = expect do - post :create, params: { organization: attributes_for(:organization) } - end - expected.not_to change(Organization, :count) - end - - it 'redirects to root' do - post :create, params: { organization: attributes_for(:organization) } - - expect(flash[:alert]).to eq('You are not authorized to access this page.') - expect(response).to redirect_to(root_path) - end - end - - describe 'PATCH #update' do - it 'does not update and redirects to root' do - old_name = organization.name - patch :update, params: { id: organization.id, organization: attributes_for(:organization, name: 'new name') } - - organization.reload - expect(organization.name).to eq(old_name) - expect(flash[:alert]).to eq('You are not authorized to access this page.') - expect(response).to redirect_to(root_path) - end - end - - describe 'DELETE #destroy' do - context 'for a valid organization' do - it 'does not destroy a resource' do - expected = expect do - delete :destroy, params: { id: organization.id } - end - expected.not_to change(Organization, :count) - end - - it 'redirects to root' do - delete :destroy, params: { id: organization.id } - - expect(flash[:alert]).to eq('You are not authorized to access this page.') - expect(response).to redirect_to(root_path) - end - end - end - end - - context 'logged in as admin' do - before do - sign_in admin - end - - describe 'GET #new' do - before do - get :new - end - - it { expect(response).to render_template('new') } - end - - describe 'GET #index' do - before do - get :index - end - - it { expect(response).to render_template('index') } - end - - describe 'POST #create' do - context 'with valid attributes' do - it 'creates new organization' do - expected = expect do - post :create, params: { organization: attributes_for(:organization) } - end - expected.to change { Organization.count }.by(1) - end - - it 'redirects to index' do - post :create, params: { organization: attributes_for(:organization) } - - expect(flash[:notice]).to eq('Organization successfully created') - expect(response).to redirect_to(admin_organizations_path) - end - end - - context 'with invalid attributes' do - it 'does not create new organization' do - expected = expect do - post :create, params: { organization: attributes_for(:organization, name: '') } - end - expected.not_to change(Organization, :count) - end - - it 'redirects to new' do - post :create, params: { organization: attributes_for(:organization, name: '') } - - expect(flash[:error]).to eq("Name can't be blank") - expect(response).to redirect_to(new_admin_organization_path) - end - end - end - - describe 'PATCH #update' do - it 'saves and redirects to index when the attributes are valid' do - patch :update, - params: { id: organization.id, organization: attributes_for(:organization, name: 'changed name') } - - organization.reload - expect(organization.name).to eq('changed name') - expect(flash[:notice]).to eq('Organization successfully updated') - expect(response).to redirect_to(admin_organizations_path) - end - - it 'redirects to edit when attributes are invalid' do - patch :update, params: { id: organization.id, organization: attributes_for(:organization, name: '') } - - expect(flash[:error]).to eq("Name can't be blank") - expect(response).to redirect_to(edit_admin_organization_path(organization)) - end - end - - describe 'DELETE #destroy' do - context 'for a valid organization' do - it 'successfullies destroy a resource' do - expected = expect do - delete :destroy, params: { id: organization.id } - end - expected.to change { Organization.count }.by(-1) - end - - it 'redirects to index' do - delete :destroy, params: { id: organization.id } - - expect(flash[:notice]).to eq('Organization successfully destroyed') - expect(response).to redirect_to(admin_organizations_path) - end - end - end - - describe 'POST #assign_org_admins' do - let(:org_admin_role) { Role.find_by(name: 'organization_admin', resource: organization) } - - before do - post :assign_org_admins, params: { id: organization.id, - user: { email: user.email } } - end - - it 'assigns organization_admin role' do - expect(user.roles).to eq [org_admin_role] - end - end - - describe 'DELETE #unassign_org_admins' do - let(:org_admin_role) { Role.find_by(name: 'organization_admin', resource: organization) } - let!(:org_admin_user) { create(:user, role_ids: [org_admin_role.id]) } - - before do - delete :unassign_org_admins, params: { id: organization.id, - user: { email: org_admin_user.email } } - end - - it 'unassigns organization_admin role' do - expect(org_admin_user.reload.roles).to eq [] - end - end - end -end diff --git a/spec/controllers/conference_registration_controller_spec.rb b/spec/controllers/conference_registration_controller_spec.rb index dfe04003b..589882a09 100644 --- a/spec/controllers/conference_registration_controller_spec.rb +++ b/spec/controllers/conference_registration_controller_spec.rb @@ -12,10 +12,14 @@ shared_examples 'access #new action' do |user, ichain, path, message| before do sign_in send(user) if user - stub_const('ENV', ENV.to_hash.merge('OSEM_ICHAIN_ENABLED' => ichain)) + ENV['OSEM_ICHAIN_ENABLED'] = ichain get :new, params: { conference_id: conference.short_title } end + after :each do + ENV['OSEM_ICHAIN_ENABLED'] = nil + end + it 'redirects' do expect(response).to redirect_to path end @@ -28,10 +32,14 @@ shared_examples 'can access #new action' do |user, ichain| before do sign_in send(user) if user - stub_const('ENV', ENV.to_hash.merge('OSEM_ICHAIN_ENABLED' => ichain)) + ENV['OSEM_ICHAIN_ENABLED'] = ichain get :new, params: { conference_id: conference.short_title } end + after :each do + ENV['OSEM_ICHAIN_ENABLED'] = nil + end + it 'user variable exists' do expect(assigns(:user)).not_to be_nil end diff --git a/spec/controllers/organizations_controller_spec.rb b/spec/controllers/organizations_controller_spec.rb deleted file mode 100644 index 963863dc1..000000000 --- a/spec/controllers/organizations_controller_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe OrganizationsController do - let!(:organization) { create(:organization) } - let!(:conference) do - create( - :conference, - splashpage: create(:splashpage, public: true), - venue: create(:venue), - organization: organization - ) - end - let!(:antiquated_conference) do - create( - :conference, - splashpage: create(:splashpage, public: true), - venue: create(:venue), - organization: organization, - start_date: 2.weeks.ago, - end_date: 1.week.ago - ) - end - - let!(:other_conference) { create(:conference) } - let!(:user) { create(:user) } - - describe 'GET #index' do - before do - sign_in user - get :index - end - - it { expect(response).to render_template('index') } - end - - describe 'GET #conferences' do - before do - get :conferences, params: { id: organization.id } - end - - it 'loads the organization' do - expect(assigns(:organization)).to eq organization - end - - it 'includes organization conferences' do - expect(assigns(:current)).to include conference - end - - it 'does not include conferences outside organization' do - expect(assigns(:current)).not_to include other_conference - expect(assigns(:antiquated)).not_to include other_conference - end - - it 'includes antiquated organization conferences' do - expect(assigns(:antiquated)).to include antiquated_conference - end - end -end diff --git a/spec/factories/conferences.rb b/spec/factories/conferences.rb index 5c1f9377a..a0f2088ed 100644 --- a/spec/factories/conferences.rb +++ b/spec/factories/conferences.rb @@ -30,12 +30,9 @@ # use_vpositions :boolean default(FALSE) # created_at :datetime # updated_at :datetime -# organization_id :integer # # Indexes # -# index_conferences_on_organization_id (organization_id) -# FactoryBot.define do factory :conference do @@ -49,8 +46,6 @@ registration_limit { 0 } ticket_layout { 'portrait' } description { Faker::Hipster.paragraph } - organization - color { '#FFFFFF' } after(:create) do |conference| Role.where(name: 'organizer', resource: conference).first_or_create(description: 'For the organizers of the conference (who shall have full access)') diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb deleted file mode 100644 index 013b144cb..000000000 --- a/spec/factories/organizations.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: organizations -# -# id :bigint not null, primary key -# code_of_conduct :text -# description :text -# name :string not null -# picture :string -# -FactoryBot.define do - factory :organization do - sequence(:name) { |n| "#{Faker::Company.name} #{n}" } - description { Faker::Lorem.paragraph } - - # after(:create) do |organization| - # File.open("spec/support/logos/#{1 + rand(13)}.png") do |file| - # organization.picture = file - # end - # organization.save! - # end - end -end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index f9135376c..fcd84d14c 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -119,17 +119,6 @@ biography { '
' } end - factory :organization_admin, parent: :user do - transient do - organization { create(:organization) } - end - - after(:create) do |user, evaluator| - user.roles << Role.find_or_create_by(name: 'organization_admin', resource: evaluator.organization) - user.save! - end - end - factory :organizer, parent: :user do transient do resource { create(:resource) } diff --git a/spec/features/base_controller_spec.rb b/spec/features/base_controller_spec.rb index ee5fd5912..552792ef3 100644 --- a/spec/features/base_controller_spec.rb +++ b/spec/features/base_controller_spec.rb @@ -30,8 +30,8 @@ it 'not an admin it redirects to root_path' do visit admin_conferences_path - expect(page).to have_current_path root_path, ignore_query: true - expect(flash).to eq 'You are not authorized to access this page.' + expect(current_path).to eq root_path + within('#flash') { expect(page).to have_text('You are not authorized to access this page.') } end it 'an admin they can access the admin area' do diff --git a/spec/features/cfp_ability_spec.rb b/spec/features/cfp_ability_spec.rb index 8416692d7..6ef1b010a 100644 --- a/spec/features/cfp_ability_spec.rb +++ b/spec/features/cfp_ability_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } +feature 'Has correct abilities' do + + let(:conference) { create(:full_conference) } let(:role_cfp) { Role.find_by(name: 'cfp', resource: conference) } let(:user_cfp) { create(:user, role_ids: [role_cfp.id]) } @@ -13,16 +13,16 @@ sign_in user_cfp end - it 'for organization and conference attributes' do + scenario 'for conference attributes' do visit admin_conference_path(conference.short_title) expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).not_to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") + expect(page).to have_no_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") expect(page).to have_text('Basics') - expect(page).not_to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") + expect(page).to have_no_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials") - expect(page).not_to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") + expect(page).to have_no_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") expect(page).to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") expect(page).to have_link('Program', href: "/admin/conferences/#{conference.short_title}/program") @@ -34,20 +34,18 @@ href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") expect(page).to have_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules") expect(page).to have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports") - expect(page).not_to have_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") - expect(page).not_to have_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") + expect(page).to have_no_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") + expect(page).to have_no_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") - expect(page).not_to have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") - expect(page).not_to have_link('Registration Period', - href: "/admin/conferences/#{conference.short_title}/registration_period") - expect(page).not_to have_text('Donations') - expect(page).not_to have_link('Sponsorship Levels', - href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") - expect(page).not_to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") - expect(page).not_to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") + expect(page).to have_no_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") + expect(page).to have_no_link('Registration Period', href: "/admin/conferences/#{conference.short_title}/registration_period") + expect(page).to have_no_text('Donations') + expect(page).to have_no_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") + expect(page).to have_no_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") + expect(page).to have_no_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles") expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") - expect(page).not_to have_link('New Conference', href: '/admin/conferences/new') + expect(page).to have_no_link('New Conference', href: '/admin/conferences/new') visit admin_conference_venue_rooms_path(conference.short_title) expect(page).to have_current_path(admin_conference_venue_rooms_path(conference.short_title), ignore_query: true) @@ -194,15 +192,6 @@ visit admin_conference_path(conference.short_title) expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) - visit admin_organizations_path - expect(page).to have_current_path(admin_organizations_path, ignore_query: true) - - visit edit_admin_organization_path(organization) - expect(page).to have_current_path(root_path, ignore_query: true) - - visit new_admin_organization_path - expect(page).to have_current_path(root_path, ignore_query: true) - visit edit_admin_conference_path(conference.short_title) expect(page).to have_current_path(root_path, ignore_query: true) diff --git a/spec/features/code_of_conduct_spec.rb b/spec/features/code_of_conduct_spec.rb deleted file mode 100644 index 633ebe113..000000000 --- a/spec/features/code_of_conduct_spec.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'Code of Conduct:' do - let!(:organization) { create(:organization) } - let!(:conference) { create(:full_conference, organization: organization) } - let(:admin) { create(:admin) } - let(:sample_text) { Faker::Lorem.paragraph } - - context 'on an organization' do - describe 'as admin' do - before { sign_in admin } - - it 'can add and remove' do - visit admin_organizations_path - within "tr#organization-#{organization.id}" do - expect(page).not_to have_css 'i.fa-check' - click_on 'Edit' - end - expect(page).to have_field 'organization[code_of_conduct]', with: '' - fill_in 'organization[code_of_conduct]', with: sample_text - click_on 'Update Organization' - within "tr#organization-#{organization.id}" do - expect(page).to have_css 'i.fa-check' - click_on 'Edit' - end - expect(page).to have_field 'organization[code_of_conduct]', with: sample_text - fill_in 'organization[code_of_conduct]', with: '' - click_on 'Update Organization' - within "tr#organization-#{organization.id}" do - expect(page).not_to have_css 'i.fa-check' - end - end - end - - describe 'anonymously' do - let!(:organization) { create(:organization, code_of_conduct: sample_text) } - - context 'on the organization' do - it 'can be read' do - visit organizations_path - within "#organization-#{organization.id}" do - click_on 'Code of Conduct' - end - expect(page).to have_text(sample_text) - end - end - - context 'on a conference' do - it 'is linked from the index' do - visit conferences_path - within "#conference-#{conference.id}" do - click_on 'Code of Conduct' - end - expect(page).to have_text(sample_text) - end - - it 'is included in the splash page', js: true do - visit conference_path(conference) - click_on 'Code of Conduct' - expect(page).to have_text(sample_text) - end - end - end - - describe 'as a participant' do - let!(:organization) { create(:organization, code_of_conduct: sample_text) } - let!(:participant) { create(:user) } - - before do - sign_in participant - visit conferences_path - within "#conference-#{conference.id}" do - click_on 'Register' - end - end - - it 'can be viewed', js: true do - page.find('input#registration_accepted_code_of_conduct') - expect(page).to have_text('I have read and accept the Code of Conduct') - expect(page).not_to have_text(sample_text) - within 'form' do - click_on 'Code of Conduct' - end - page.find('.modal-dialog') - expect(page).to have_content(sample_text) - end - end - end -end diff --git a/spec/features/commercials_spec.rb b/spec/features/commercials_spec.rb index 8c9899eb8..068fcbea0 100644 --- a/spec/features/commercials_spec.rb +++ b/spec/features/commercials_spec.rb @@ -25,9 +25,8 @@ # Workaround to enable the 'Create Commercial' button page.execute_script("$('#commercial_submit_action').prop('disabled', false)") - click_button 'Create Materials' - page.find('#flash') - expect(flash).to eq('Materials were successfully created.') + click_button 'Create Commercial' + within('#flash') { expect(page).to have_text('Commercial was successfully created.') } end it 'updates a commercial of an event', feature: true, js: true do @@ -42,9 +41,7 @@ page.execute_script("$('#commercial_submit_action').prop('disabled', false)") click_button 'Update Materials' end - - page.find('#flash') - expect(flash).to eq('Materials were successfully updated.') + within('#flash') { expect(page).to have_text('Commercial was successfully updated.') } expect(event.commercials.count).to eq(1) commercial.reload expect(commercial.url).to eq('https://www.youtube.com/watch?v=M9bq_alk-sw') @@ -59,8 +56,7 @@ page.accept_alert do click_link 'Delete' end - page.find('#flash') - expect(flash).to eq('Materials were successfully destroyed.') + within('#flash') { expect(page).to have_text('Commercial was successfully destroyed.') } expect(event.commercials.count).to eq(0) end end diff --git a/spec/features/conference_registration_spec.rb b/spec/features/conference_registration_spec.rb index 0d2ad368a..8ad0c43c6 100644 --- a/spec/features/conference_registration_spec.rb +++ b/spec/features/conference_registration_spec.rb @@ -41,20 +41,16 @@ page.accept_alert do click_link 'Unregister' end - page.find('#flash') expect(page).to have_content('not registered') expect(conference.user_registered?(participant)).to be(false) end end context 'who is not registered' do - it 'registers for a conference', feature: true, js: true do - visit root_path - click_link 'Register' - - expect(page).to have_current_path(new_conference_conference_registration_path(conference.short_title), - ignore_query: true) + scenario 'registers for a conference', feature: true, js: true do + visit new_conference_conference_registration_path(conference.short_title) click_button 'Register' + within('#flash') { expect(page).to have_text('You are now registered and will be receiving E-Mail notifications.') } expect(conference.user_registered?(participant)).to be(true) end diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index eb00a0799..cdc443de6 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -2,38 +2,30 @@ require 'spec_helper' -describe Conference do - let!(:user) { create(:admin) } - let!(:organization) { create(:organization) } +feature Conference do + let(:user) { create(:admin) } - shared_examples 'add and update conference' do - it 'adds a new conference', feature: true, js: true do + describe 'admin' do + let(:conference) { create(:conference) } + + scenario 'adds a new conference', feature: true, js: true do expected_count = Conference.count + 1 sign_in user visit new_admin_conference_path - select organization.name, from: 'conference_organization_id' fill_in 'conference_title', with: 'Example Con' fill_in 'conference_short_title', with: 'ExCon' select('(GMT+01:00) Berlin', from: 'conference[timezone]') - today = Date.today - 1 - page - .execute_script("$('#conference-start-datepicker').val('" + - "#{today.strftime('%d/%m/%Y')}')") - page - .execute_script("$('#conference-end-datepicker').val('" + - "#{(today + 7).strftime('%d/%m/%Y')}')") - + today = Time.zone.today - 1 + fill_in 'conference_start_date', with: today.strftime('%Y/%m/%d') + fill_in 'conference_end_date', with: (today + 7).strftime('%Y/%m/%d') click_button 'Create Conference' - page.find('#flash') - expect(flash) - .to eq('Conference was successfully created.') + within('#flash') { expect(page).to have_text('Conference was successfully created.') } expect(Conference.count).to eq(expected_count) - expect(Conference.last.organization).to eq(organization) user.reload expect(user.has_cached_role?(:organizer, Conference.last)).to be(true) end @@ -50,20 +42,14 @@ fill_in 'conference_title', with: 'New Con' fill_in 'conference_short_title', with: 'NewCon' - day = Date.today + 10 - page - .execute_script("$('#conference-start-datepicker').val('" + - "#{day.strftime('%d/%m/%Y')}')") - page - .execute_script("$('#conference-end-datepicker').val('" + - "#{(day + 7).strftime('%d/%m/%Y')}')") - + day = Time.zone.today + 10 + fill_in 'conference_start_date', with: day.strftime('%Y/%m/%d') + fill_in 'conference_end_date', with: (day + 7).strftime('%Y/%m/%d') page.accept_alert do click_button 'Update Conference' end - page.find('#flash') - expect(flash).to eq('Conference was successfully updated.') + within('#flash') { expect(page).to have_text('Conference was successfully updated.') } conference.reload expect(conference.title).to eq('New Con') @@ -71,51 +57,4 @@ expect(Conference.count).to eq(expected_count) end end - - describe 'admin' do - let!(:conference) { create(:conference) } - - it 'has organization name in menu bar for conference views', feature: true, js: true do - sign_in user - visit admin_conference_path(conference.short_title) - - expect(find('.navbar-brand img')['alt']).to have_content conference.organization.name - end - - it_behaves_like 'add and update conference' - end - - describe 'user views' do - let!(:conference) { create(:full_conference, description: 'Welcome to this conference!', registered_attendees_message: 'This is an exclusive message!') } - let!(:registered_user) { create(:user) } - let!(:not_registered_user) { create(:user) } - let!(:registration) { create(:registration, user: registered_user, conference: conference) } - - context 'when user is registered for conference' do - before do - sign_in registered_user - visit conference_path(conference.short_title) - end - - it 'shows registered attendees message and description' do - expect(page).to have_content('Welcome to this conference!') - expect(page).to have_content('This is an exclusive message!') - end - end - - context 'when user is not registered for conference' do - before do - sign_in not_registered_user - visit conference_path(conference) - end - - it 'shows conference description' do - expect(page).to have_content('Welcome to this conference!') - end - - it 'does not show registered attendees message' do - expect(page).to have_no_content('This is an exclusive message!') - end - end - end end diff --git a/spec/features/contact_spec.rb b/spec/features/contact_spec.rb index c246271d8..5df3ba1d3 100644 --- a/spec/features/contact_spec.rb +++ b/spec/features/contact_spec.rb @@ -14,12 +14,9 @@ visit edit_admin_conference_contact_path(conference.short_title) fill_in 'contact_' + field_name, with: field_value click_button 'Update Contact' - page.find('#flash') - expect(flash) - .to eq('Contact details were successfully updated.') - contact.reload + within('#flash') { expect(page).to have_text('Contact details were successfully updated.') } - expect(contact.send(field_name)).to eq(field_value) + expect(contact.reload.send(field_name)).to eq(field_value) expect(Contact.count).to eq(expected_count) end end diff --git a/spec/features/difficulty_levels_spec.rb b/spec/features/difficulty_levels_spec.rb index 1c2795488..f7de4d569 100644 --- a/spec/features/difficulty_levels_spec.rb +++ b/spec/features/difficulty_levels_spec.rb @@ -19,11 +19,9 @@ fill_in 'difficulty_level_title', with: 'Hard' fill_in 'difficulty_level_description', with: 'Life is the hardest' page.find('#difficulty_level_color').set('#ff0000') - click_button 'Create Difficulty level' - page.find('#flash') - # Validations - expect(flash).to eq('Difficulty level successfully created.') + + within('#flash') { expect(page).to have_text('Difficulty level successfully created.') } within('table#difficulty_levels') do expect(page.has_content?('Hard')).to be true expect(page.has_content?('Life is the hardest')).to be true @@ -44,10 +42,8 @@ click_link 'Delete' end end - page.find('#flash') - # Validations - expect(flash).to eq('Difficulty level successfully deleted.') + within('#flash') { expect(page).to have_text('Difficulty level successfully deleted.') } within('table#difficulty_levels') do expect(page.assert_selector('tr', count: 4)).to be true expect(page.has_content?('Easy Events')).to be true diff --git a/spec/features/email_spec.rb b/spec/features/email_spec.rb index 9885b18d8..8253b753a 100644 --- a/spec/features/email_spec.rb +++ b/spec/features/email_spec.rb @@ -53,10 +53,8 @@ with: 'Updated conference venue template' click_button 'Update Email settings' - page.find('#flash') - expect(flash) - .to eq('Email settings have been successfully updated.') + within('#flash') { expect(page).to have_text('Email settings have been successfully updated.') } expect(find('#email_settings_registration_subject') .value).to eq('Registration subject') expect(find('#email_settings_registration_body') diff --git a/spec/features/event_types_spec.rb b/spec/features/event_types_spec.rb index 09342050c..abc421370 100644 --- a/spec/features/event_types_spec.rb +++ b/spec/features/event_types_spec.rb @@ -29,10 +29,7 @@ page.find('#event_type_color').set('#e4e4e4') click_button 'Create Event type' - page.find('#flash') - # Validations - # binding.pry - expect(flash).to eq('Event type successfully created.') + within('#flash') { expect(page).to have_text('Event type successfully created.') } within('table#event_types > tbody') do expect(page.has_content?('Party')).to be true expect(page.has_content?('13042')).to be true @@ -46,9 +43,8 @@ within('tr', text: 'Party') do click_link 'Delete' end - page.find('#flash') - expect(flash).to eq('Event type successfully deleted.') + within('#flash') { expect(page).to have_text('Event type successfully deleted.') } within('table#event_types > tbody') do expect(page.assert_selector('tr', count: 2)).to be true expect(page.has_content?('Party')).to be false diff --git a/spec/features/info_desk_ability_spec.rb b/spec/features/info_desk_ability_spec.rb index 935e2ba27..6c3ae8864 100644 --- a/spec/features/info_desk_ability_spec.rb +++ b/spec/features/info_desk_ability_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } +feature 'Has correct abilities' do + + let(:conference) { create(:full_conference) } let(:role_info_desk) { Role.find_by(name: 'info_desk', resource: conference) } let(:user_info_desk) { create(:user, role_ids: [role_info_desk.id]) } @@ -13,52 +13,38 @@ sign_in user_info_desk end - it 'for organization and conference attributes' do + scenario 'for conference attributes' do visit admin_conference_path(conference.short_title) expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) - expect(page).not_to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") + expect(page).to have_no_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") expect(page).to have_text('Basics') - expect(page).not_to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") - expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials") - expect(page).not_to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") - expect(page).not_to have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") - expect(page).not_to have_link('Registration Period', - href: "/admin/conferences/#{conference.short_title}/registration_period") - expect(page).not_to have_text('Donations') - expect(page).not_to have_link('Sponsorship Levels', - href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") - expect(page).not_to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") - expect(page).not_to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") + expect(page).to have_no_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") + expect(page).to have_link('Material', href: "/admin/conferences/#{conference.short_title}/commercials") + expect(page).to have_no_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") + expect(page).to have_no_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") + expect(page).to have_no_link('Registration Period', href: "/admin/conferences/#{conference.short_title}/registration_period") + expect(page).to have_no_text('Donations') + expect(page).to have_no_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") + expect(page).to have_no_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") + expect(page).to have_no_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles") expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).not_to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") - expect(page).not_to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") - expect(page).not_to have_link('Program', href: "/admin/conferences/#{conference.short_title}/program") - expect(page).not_to have_link('Call for Papers', - href: "/admin/conferences/#{conference.short_title}/program/cfps") - expect(page).not_to have_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events") - expect(page).not_to have_link('Tracks', href: "/admin/conferences/#{conference.short_title}/program/tracks") - expect(page).not_to have_link('Event Types', - href: "/admin/conferences/#{conference.short_title}/program/event_types") - expect(page).not_to have_link('Difficulty Levels', - href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") - expect(page).not_to have_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules") - expect(page).not_to have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports") + expect(page).to have_no_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") + expect(page).to have_no_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") + expect(page).to have_no_link('Program', href: "/admin/conferences/#{conference.short_title}/program") + expect(page).to have_no_link('Call for Papers', href: "/admin/conferences/#{conference.short_title}/program/cfps") + expect(page).to have_no_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events") + expect(page).to have_no_link('Tracks', href: "/admin/conferences/#{conference.short_title}/program/tracks") + expect(page).to have_no_link('Event Types', href: "/admin/conferences/#{conference.short_title}/program/event_types") + expect(page).to have_no_link('Difficulty Levels', href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") + expect(page).to have_no_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules") + expect(page).to have_no_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports") expect(page).to have_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") expect(page).to have_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") - expect(page).not_to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") - expect(page).not_to have_link('New Conference', href: '/admin/conferences/new') - - visit admin_organizations_path - expect(page).to have_current_path(admin_organizations_path, ignore_query: true) - - visit edit_admin_organization_path(organization) - expect(page).to have_current_path(root_path, ignore_query: true) - - visit new_admin_organization_path - expect(page).to have_current_path(root_path, ignore_query: true) + expect(page).to have_no_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") + expect(page).to have_no_link('New Conference', href: '/admin/conferences/new') visit edit_admin_conference_path(conference.short_title) expect(page).to have_current_path(root_path, ignore_query: true) diff --git a/spec/features/lodgings_spec.rb b/spec/features/lodgings_spec.rb index fd797f3c9..63e79ed1e 100644 --- a/spec/features/lodgings_spec.rb +++ b/spec/features/lodgings_spec.rb @@ -19,11 +19,9 @@ fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_website_link', with: 'http://www.google.com' attach_file 'Picture', path - click_button 'Create Lodging' - page.find('#flash') - # Validations - expect(flash).to eq('Lodging successfully created.') + + within('#flash') { expect(page).to have_text('Lodging successfully created.') } expect(page.has_content?('New lodging')).to be true expect(Lodging.count).to eq(1) end @@ -46,11 +44,9 @@ fill_in 'lodging_name', with: 'New lodging' fill_in 'lodging_website_link', with: 'http://www.google.com' attach_file 'Picture', path - click_button 'Update Lodging' - page.find('#flash') - # Validations - expect(flash).to eq('Lodging successfully updated.') + + within('#flash') { expect(page).to have_text('Lodging successfully updated.') } expect(page.has_content?('New lodging')).to be true lodging.reload expect(lodging.name).to eq('New lodging') @@ -72,9 +68,8 @@ page.accept_alert do click_link 'Delete' end - page.find('#flash') - # Validations - expect(flash).to eq('Lodging successfully deleted.') + + within('#flash') { expect(page).to have_text('Lodging successfully deleted.') } expect(page.has_content?(CGI.escapeHTML(lodging.name))).to be false expect(Lodging.count).to eq(0) end diff --git a/spec/features/omniauth_spec.rb b/spec/features/omniauth_spec.rb index 4ad7e8ac3..61d8e910a 100644 --- a/spec/features/omniauth_spec.rb +++ b/spec/features/omniauth_spec.rb @@ -19,8 +19,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('test-1@example.com signed in successfully with google') + + within('#flash') { expect(page).to have_text('test-1@example.com signed in successfully with google') } expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) end @@ -35,8 +35,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('test-participant-1@example.com signed in successfully with google') + + within('#flash') { expect(page).to have_text('test-participant-1@example.com signed in successfully with google') } expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) end @@ -48,8 +48,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('Could not authenticate you from Google because "Invalid credentials".') + + within('#flash') { expect(page).to have_text('Could not authenticate you from Google because "Invalid credentials".') } end it 'adds openid to existing user' do @@ -66,8 +66,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('test-participant-1@example.com signed in successfully with google') + + within('#flash') { expect(page).to have_text('test-participant-1@example.com signed in successfully with google') } expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) expect(Openid.where(email: 'test-1@example.com').first.nil?).to be(false) @@ -84,8 +84,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('test-participant-1@example.com signed in successfully with google') + + within('#flash') { expect(page).to have_text('test-participant-1@example.com signed in successfully with google') } page.find('#flash .close').click expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) @@ -99,8 +99,8 @@ within('#openidlinks') do click_link 'omniauth-google' end - page.find('#flash') - expect(flash).to eq('test-participant-1@example.com signed in successfully with google') + + within('#flash') { expect(page).to have_text('test-participant-1@example.com signed in successfully with google') } page.find('#flash .close').click expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) @@ -117,8 +117,7 @@ within('#openidlinks') do click_link 'omniauth-facebook' end - page.find('#flash') - expect(flash).to eq('test-participant-1@example.com signed in successfully with facebook') + within('#flash') { expect(page).to have_text('test-participant-1@example.com signed in successfully with facebook') } expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) last_openid = Openid.last @@ -143,8 +142,8 @@ within('#openidlinks') do click_link "omniauth-#{provider}" end - page.find('#flash') - expect(flash).to eq("user-#{provider}@example.com signed in successfully with #{provider}") + + within('#flash') { expect(page).to have_text("user-#{provider}@example.com signed in successfully with #{provider}") } expect(Openid.count).to eq(expected_count_openid) expect(User.count).to eq(expected_count_user) end diff --git a/spec/features/organization_admin_ability_spec.rb b/spec/features/organization_admin_ability_spec.rb deleted file mode 100644 index c7480ba57..000000000 --- a/spec/features/organization_admin_ability_spec.rb +++ /dev/null @@ -1,306 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } - let(:role_organization_admin) { Role.find_by(name: 'organization_admin', resource: organization) } - let(:user_organization_admin) { create(:user, role_ids: [role_organization_admin.id]) } - let!(:registration_ticket) { create(:registration_ticket, conference: conference) } - - context 'when user is organization_admin' do - before do - sign_in user_organization_admin - end - - it 'for organization attributes' do - visit admin_organizations_path - expect(page).to have_current_path(admin_organizations_path, ignore_query: true) - - visit edit_admin_organization_path(organization) - expect(page).to have_current_path(edit_admin_organization_path(organization), ignore_query: true) - - visit new_admin_organization_path - expect(page).to have_current_path(root_path, ignore_query: true) - end - - it 'for conference attributes' do - visit admin_conference_path(conference.short_title) - expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) - - expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") - expect(page).to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") - expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials") - expect(page).to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") - expect(page).to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") - expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") - expect(page).to have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") - expect(page).to have_link('Program', href: "/admin/conferences/#{conference.short_title}/program") - expect(page).to have_link('Calls for Content', href: "/admin/conferences/#{conference.short_title}/program/cfps") - expect(page).to have_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events") - expect(page).to have_link('Tracks', href: "/admin/conferences/#{conference.short_title}/program/tracks") - expect(page).to have_link('Event Types', href: "/admin/conferences/#{conference.short_title}/program/event_types") - expect(page).to have_link('Difficulty Levels', - href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") - expect(page).to have_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules") - expect(page).to have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports") - expect(page).to have_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") - expect(page).to have_link('Registration Period', - href: "/admin/conferences/#{conference.short_title}/registration_period") - expect(page).to have_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") - expect(page).to have_text('Donations') - expect(page).to have_link('Sponsorship Levels', - href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") - expect(page).to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") - expect(page).to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") - expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") - expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles") - expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") - expect(page).to have_link('New Conference', href: '/admin/conferences/new') - - visit edit_admin_conference_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_path(conference.short_title), ignore_query: true) - - visit edit_admin_conference_contact_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_contact_path(conference.short_title), ignore_query: true) - - visit admin_conference_commercials_path(conference.short_title) - expect(page).to have_current_path(admin_conference_commercials_path(conference.short_title), ignore_query: true) - - visit new_admin_conference_splashpage_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_splashpage_path(conference.short_title), - ignore_query: true) - - visit edit_admin_conference_splashpage_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_splashpage_path(conference.short_title), - ignore_query: true) - - visit new_admin_conference_venue_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_venue_path(conference.short_title), ignore_query: true) - - conference.venue = create(:venue) - visit edit_admin_conference_venue_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_venue_path(conference.short_title), ignore_query: true) - - visit admin_conference_venue_rooms_path(conference.short_title) - expect(page).to have_current_path(admin_conference_venue_rooms_path(conference.short_title), ignore_query: true) - - create(:room, venue: conference.venue) - visit edit_admin_conference_venue_room_path(conference.short_title, conference.venue.rooms.first) - expect(page).to have_current_path(edit_admin_conference_venue_room_path(conference.short_title, - conference.venue.rooms.first), ignore_query: true) - - visit admin_conference_lodgings_path(conference.short_title) - expect(page).to have_current_path(admin_conference_lodgings_path(conference.short_title), ignore_query: true) - - visit new_admin_conference_lodging_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_lodging_path(conference.short_title), ignore_query: true) - - create(:lodging, conference: conference) - visit edit_admin_conference_lodging_path(conference.short_title, conference.lodgings.first) - expect(page).to have_current_path( - edit_admin_conference_lodging_path(conference.short_title, conference.lodgings.first), ignore_query: true - ) - - visit new_admin_conference_program_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_path(conference.short_title), ignore_query: true) - - visit edit_admin_conference_program_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_program_path(conference.short_title), ignore_query: true) - - # Only event exists - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true) - - # Event and booth cfps exist - cfb = create(:cfp, cfp_type: 'booths', program: conference.program) - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true - - visit edit_admin_conference_program_cfp_path(conference.short_title, conference.program.cfp) - expect(page).to have_current_path( - edit_admin_conference_program_cfp_path(conference.short_title, conference.program.cfp), ignore_query: true - ) - - # Event, booth, track cfps exist - call_for_tracks = create(:cfp, cfp_type: 'tracks', program: conference.program) - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path root_path, ignore_query: true - - # Booth and track cfps exist - conference.program.cfp.destroy! - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true - - # Only booth exists - call_for_tracks.destroy! - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true) - - visit edit_admin_conference_program_cfp_path(conference.short_title, cfb) - expect(page).to have_current_path(edit_admin_conference_program_cfp_path(conference.short_title, cfb), - ignore_query: true) - - # No cfp exists - cfb.destroy - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true) - - # Only Tracks cfp exists - call_for_tracks = create(:cfp, cfp_type: 'tracks', program: conference.program) - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true - - visit edit_admin_conference_program_cfp_path(conference.short_title, call_for_tracks) - expect(page).to have_current_path edit_admin_conference_program_cfp_path(conference.short_title, call_for_tracks), - ignore_query: true - - # Event and track cfps exist - create(:cfp, cfp_type: 'events', program: conference.program) - visit new_admin_conference_program_cfp_path(conference.short_title) - expect(page).to have_current_path new_admin_conference_program_cfp_path(conference.short_title), - ignore_query: true - - call_for_tracks.destroy! - visit admin_conference_program_events_path(conference.short_title) - expect(page).to have_current_path(admin_conference_program_events_path(conference.short_title), - ignore_query: true) - - create(:event, program: conference.program) - visit edit_admin_conference_program_event_path(conference.short_title, conference.program.events.first) - expect(page).to have_current_path(edit_admin_conference_program_event_path(conference.short_title, - conference.program.events.first), ignore_query: true) - - visit admin_conference_program_event_types_path(conference.short_title) - expect(page).to have_current_path(admin_conference_program_event_types_path(conference.short_title), - ignore_query: true) - - visit new_admin_conference_program_event_type_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_event_type_path(conference.short_title), - ignore_query: true) - - visit edit_admin_conference_program_event_type_path(conference.short_title, conference.program.event_types.first) - expect(page).to have_current_path(edit_admin_conference_program_event_type_path(conference.short_title, - conference.program.event_types.first), ignore_query: true) - - visit admin_conference_program_difficulty_levels_path(conference.short_title) - expect(page).to have_current_path(admin_conference_program_difficulty_levels_path(conference.short_title), - ignore_query: true) - - visit new_admin_conference_program_difficulty_level_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_program_difficulty_level_path(conference.short_title), - ignore_query: true) - - visit edit_admin_conference_program_difficulty_level_path(conference.short_title, - conference.program.difficulty_levels.first) - expect(page).to have_current_path(edit_admin_conference_program_difficulty_level_path(conference.short_title, - conference.program.difficulty_levels.first), ignore_query: true) - - visit admin_conference_schedules_path(conference.short_title) - expect(page).to have_current_path(admin_conference_schedules_path(conference.short_title), ignore_query: true) - - create(:schedule, program: conference.program) - visit admin_conference_schedule_path(conference.short_title, conference.program.schedules.first) - expect(page).to have_current_path(admin_conference_schedule_path(conference.short_title, - conference.program.schedules.first), ignore_query: true) - - visit admin_conference_program_reports_path(conference.short_title) - expect(page).to have_current_path(admin_conference_program_reports_path(conference.short_title), - ignore_query: true) - - visit admin_conference_registrations_path(conference.short_title) - expect(page).to have_current_path(admin_conference_registrations_path(conference.short_title), ignore_query: true) - - # Create a registration for a user, which requires a registration ticket. - other_user = create(:user) - ticket = conference.registration_tickets.first - create(:paid_ticket_purchase, - user: other_user, ticket: ticket, quantity: 1, conference: conference) - create(:registration, user: other_user, conference: conference) - visit edit_admin_conference_registration_path(conference.short_title, conference.registrations.first) - expect(page).to have_current_path(edit_admin_conference_registration_path(conference.short_title, - conference.registrations.first), ignore_query: true) - - visit new_admin_conference_registration_period_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_registration_period_path(conference.short_title), - ignore_query: true) - - create(:registration_period, conference: conference) - visit edit_admin_conference_registration_period_path(conference.short_title) - expect(page).to have_current_path(edit_admin_conference_registration_period_path(conference.short_title), - ignore_query: true) - - visit admin_conference_questions_path(conference.short_title) - expect(page).to have_current_path(admin_conference_questions_path(conference.short_title), ignore_query: true) - - visit admin_conference_sponsorship_levels_path(conference.short_title) - expect(page).to have_current_path(admin_conference_sponsorship_levels_path(conference.short_title), - ignore_query: true) - - visit new_admin_conference_sponsorship_level_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_sponsorship_level_path(conference.short_title), - ignore_query: true) - - create(:sponsorship_level, conference: conference) - visit edit_admin_conference_sponsorship_level_path(conference.short_title, conference.sponsorship_levels.first) - expect(page).to have_current_path(edit_admin_conference_sponsorship_level_path(conference.short_title, - conference.sponsorship_levels.first), ignore_query: true) - - visit admin_conference_sponsors_path(conference.short_title) - expect(page).to have_current_path(admin_conference_sponsors_path(conference.short_title), ignore_query: true) - - visit new_admin_conference_sponsor_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_sponsor_path(conference.short_title), ignore_query: true) - - create(:sponsor, conference: conference, sponsorship_level: conference.sponsorship_levels.first) - visit edit_admin_conference_sponsor_path(conference.short_title, conference.sponsors.first) - expect(page).to have_current_path( - edit_admin_conference_sponsor_path(conference.short_title, conference.sponsors.first), ignore_query: true - ) - - visit admin_conference_tickets_path(conference.short_title) - expect(page).to have_current_path(admin_conference_tickets_path(conference.short_title), ignore_query: true) - - visit new_admin_conference_ticket_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_ticket_path(conference.short_title), ignore_query: true) - - create(:ticket, conference: conference) - visit edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first) - expect(page).to have_current_path( - edit_admin_conference_ticket_path(conference.short_title, conference.tickets.first), ignore_query: true - ) - - visit admin_conference_program_tracks_path(conference.short_title) - expect(page).to have_current_path(admin_conference_program_tracks_path(conference.short_title), - ignore_query: true) - - visit admin_conference_roles_path(conference.short_title) - expect(page).to have_current_path(admin_conference_roles_path(conference.short_title), ignore_query: true) - - visit admin_conference_emails_path(conference.short_title) - expect(page).to have_current_path(admin_conference_emails_path(conference.short_title), ignore_query: true) - - visit admin_conference_resources_path(conference.short_title) - expect(page).to have_current_path(admin_conference_resources_path(conference.short_title), ignore_query: true) - - visit new_admin_conference_resource_path(conference.short_title) - expect(page).to have_current_path(new_admin_conference_resource_path(conference.short_title), ignore_query: true) - - create(:resource, conference: conference) - visit edit_admin_conference_resource_path(conference.short_title, conference.resources.first) - expect(page).to have_current_path(edit_admin_conference_resource_path(conference.short_title, - conference.resources.first), ignore_query: true) - - visit admin_revision_history_path - expect(page).to have_current_path(admin_revision_history_path, ignore_query: true) - end - end -end diff --git a/spec/features/organization_spec.rb b/spec/features/organization_spec.rb deleted file mode 100644 index 31ee01d96..000000000 --- a/spec/features/organization_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe Organization do - let!(:organization) { create(:organization) } - let!(:organization_admin_role) { Role.find_by(name: 'organization_admin', resource: organization) } - let(:organization_admin) { create(:user, role_ids: [organization_admin_role.id]) } - let(:admin_user) { create(:admin) } - - shared_examples 'successfully updates an organization' do - it 'updates a exsisting organization', feature: true, js: true do - visit edit_admin_organization_path(organization) - fill_in 'organization_name', with: 'changed name' - - click_button 'Update Organization' - - organization.reload - page.find('#flash') - expect(flash).to eq('Organization successfully updated') - expect(organization.name).to eq('changed name') - end - end - - context 'signed in as site admin' do - before do - sign_in admin_user - end - - it 'creates a new organization', feature: true, js: true do - visit new_admin_organization_path - fill_in 'organization_name', with: 'Organization name' - - click_button 'Create Organization' - page.find('#flash') - expect(flash).to eq('Organization successfully created') - expect(Organization.last.name).to eq('Organization name') - end - - it_behaves_like 'successfully updates an organization' - end - - context 'signed in as organization admin' do - before do - sign_in organization_admin - end - - it "can't create new organization", feature: true, js: true do - visit new_admin_organization_path - page.find('#flash') - expect(flash).to eq('You are not authorized to access this page.') - end - - it_behaves_like 'successfully updates an organization' - end - - context 'anonymously' do - it 'index should link to conferences list' do - visit organizations_path - - expect(page).to have_link('Conferences', href: "/organizations/#{organization.id}/conferences") - end - end -end diff --git a/spec/features/organizer_ability_spec.rb b/spec/features/organizer_ability_spec.rb index 511c36eea..067b04fb9 100644 --- a/spec/features/organizer_ability_spec.rb +++ b/spec/features/organizer_ability_spec.rb @@ -2,13 +2,10 @@ require 'spec_helper' -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } - # user is organizer, venue is not set by default - let(:other_conference) do - create(:conference, organization: organization) - end +feature 'Has correct abilities' do + + let(:conference) { create(:full_conference) } + let(:other_conference) { create(:conference) } # user is organizer, venue is not set by default let(:role_organizer_conf) { Role.find_by(name: 'organizer', resource: conference) } let(:role_organizer_other_conf) { Role.find_by(name: 'organizer', resource: other_conference) } let(:user_organizer) { create(:user, role_ids: [role_organizer_conf.id, role_organizer_other_conf.id]) } @@ -19,18 +16,7 @@ sign_in user_organizer end - it 'for organization attributes' do - visit admin_organizations_path - expect(page).to have_current_path(admin_organizations_path, ignore_query: true) - - visit edit_admin_organization_path(organization) - expect(page).to have_current_path(root_path, ignore_query: true) - - visit new_admin_organization_path - expect(page).to have_current_path(root_path, ignore_query: true) - end - - it 'for conference attributes' do + scenario 'for conference attributes' do visit admin_conference_path(conference.short_title) expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) @@ -63,7 +49,7 @@ expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles") expect(page).to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") - expect(page).not_to have_link('New Conference', href: '/admin/conferences/new') + expect(page).to have_no_link('New Conference', href: '/admin/conferences/new') visit admin_conference_path(other_conference.short_title) # TODO-SNAPCON: This conference already seems to have a venue. diff --git a/spec/features/program_spec.rb b/spec/features/program_spec.rb index c9fa98b5f..8e34bc656 100644 --- a/spec/features/program_spec.rb +++ b/spec/features/program_spec.rb @@ -20,10 +20,8 @@ fill_in 'program_rating', with: '4' click_button 'Update Program' - page.find('#flash') - # Validations - expect(flash) - .to eq('The program was successfully updated.') + + within('#flash') { expect(page).to have_text('The program was successfully updated.') } expect(find('#rating').text).to eq('4') end end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index d09b72186..20d00cad7 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -49,7 +49,7 @@ fill_in 'Title', with: 'Organizer-Created Proposal' fill_in 'Abstract', with: 'This proposal was created by an organizer.' click_button 'Create Proposal' - expect(flash).to eq('Event was successfully submitted.') + within('#flash') { expect(page).to have_text('Event was successfully submitted.') } end scenario 'rejects a proposal', feature: true, js: true do @@ -118,9 +118,8 @@ fill_in 'event_submission_text', with: 'Lorem ipsum submission' click_button 'Create Proposal' - page.find('#flash') - expect(page).to have_content 'Proposal was successfully submitted.' + within('#flash') { expect(page).to have_text('Proposal was successfully submitted.') } expect(Event.count).to eq(expected_count_event) expect(User.count).to eq(expected_count_user) end @@ -157,8 +156,8 @@ # expect(page).to have_selector '.in', text: 'Events are understandable for everyone without knowledge of the topic.' click_button 'Update Proposal' - page.find('#flash') - expect(page).to have_content 'Proposal was successfully updated.' + + within('#flash') { expect(page).to have_text('Proposal was successfully updated.') } end it 'signed_in user submits a valid proposal', feature: true, js: true do @@ -187,9 +186,8 @@ click_button 'Create Proposal' - page.find('#flash') - expect(page).to have_content 'Proposal was successfully submitted.' - expect(page).to have_current_path(conference_program_proposals_path(conference.short_title), ignore_query: true) + within('#flash') { expect(page).to have_text('Proposal was successfully submitted.') } + expect(current_path).to eq(conference_program_proposals_path(conference.short_title)) expect(Event.count).to eq(expected_count) end @@ -213,10 +211,9 @@ expect(page).to have_content 'Example Proposal' click_link "delete_proposal_#{@event.id}" page.accept_alert - page.find('#flash') - expect(page).to have_content 'Proposal was successfully withdrawn.' - @event.reload - expect(@event.state).to eq('withdrawn') + + within('#flash') { expect(page).to have_text('Proposal was successfully withdrawn.') } + expect(@event.reload.state).to eq('withdrawn') end it 'can reset to text template', feature: true, js: true do diff --git a/spec/features/registration_periods_spec.rb b/spec/features/registration_periods_spec.rb index 1b6b4a901..2e4b0a7d7 100644 --- a/spec/features/registration_periods_spec.rb +++ b/spec/features/registration_periods_spec.rb @@ -16,64 +16,29 @@ click_link 'New Registration Period' end - it 'requires start date and end date', feature: true do - visit admin_conference_registration_period_path(conference_id: conference) - click_link 'New Registration Period' - - click_button 'Save Registration Period' - page.find('#flash') - expect(flash) - .to eq('An error prohibited the Registration Period from being saved: ' \ - "Start date can't be blank. End date can't be blank.") - end - context 'with tickets' do let!(:registration_ticket) do create(:registration_ticket, conference: conference) end it 'creates registration period', feature: true, js: true do - page - .execute_script("$('#registration-period-start-datepicker').val('" + - "#{start_date.strftime('%d/%m/%Y')}')") - page - .execute_script("$('#registration-period-end-datepicker').val('" + - "#{end_date.strftime('%d/%m/%Y')}')") - + fill_in 'registration_period_start_date', with: start_date.strftime('%Y/%m/%d') + fill_in 'registration_period_end_date', with: end_date.strftime('%Y/%m/%d') click_button 'Save Registration Period' - page.find('#flash') - expect(flash).to eq('Registration Period successfully updated.') - expect(page).to have_current_path(admin_conference_registration_period_path(conference.short_title), - ignore_query: true) + within('#flash') { expect(page).to have_text('Registration Period successfully updated.') } + expect(current_path).to eq(admin_conference_registration_period_path(conference.short_title)) expect(page).to have_text("Ticket required?\nYes") - - registration_period = RegistrationPeriod.where(conference_id: conference.id).first - registration_period.reload - expect(registration_period.start_date).to eq(start_date) - expect(registration_period.end_date).to eq(end_date) end end context 'without tickets' do it 'creates registration period', feature: true, js: true do - page - .execute_script("$('#registration-period-start-datepicker').val('" + - "#{start_date.strftime('%d/%m/%Y')}')") - page - .execute_script("$('#registration-period-end-datepicker').val('" + - "#{end_date.strftime('%d/%m/%Y')}')") - + fill_in 'registration_period_start_date', with: start_date.strftime('%Y-%m-%d') + fill_in 'registration_period_end_date', with: end_date.strftime('%Y-%m-%d') click_button 'Save Registration Period' - page.find('#flash') - expect(flash).to eq('Registration Period successfully updated.') - expect(page).to have_current_path(admin_conference_registration_period_path(conference.short_title), - ignore_query: true) + within('#flash') { expect(page).to have_text('Registration Period successfully updated.') } + expect(current_path).to eq(admin_conference_registration_period_path(conference.short_title)) expect(page).to have_text("Ticket required?\nNo") - - registration_period = RegistrationPeriod.where(conference_id: conference.id).first - registration_period.reload - expect(registration_period.start_date).to eq(start_date) - expect(registration_period.end_date).to eq(end_date) end end end diff --git a/spec/features/resource_spec.rb b/spec/features/resource_spec.rb index aa6e34d20..cac59d9e5 100644 --- a/spec/features/resource_spec.rb +++ b/spec/features/resource_spec.rb @@ -23,8 +23,7 @@ click_button 'Create Resource' expect(Resource.count).to eq(2) - page.find('#flash') - expect(flash).to eq('Resource successfully created.') + within('#flash') { expect(page).to have_text('Resource successfully created.') } end it 'edit an existing resource' do @@ -32,18 +31,16 @@ click_link('Edit') fill_in 'resource_name', with: 'changed_name' click_button 'Update Resource' - resource.reload - page.find('#flash') - expect(flash).to eq('Resource successfully updated.') - expect(resource.name).to eq('changed_name') + + within('#flash') { expect(page).to have_text('Resource successfully updated.') } + expect(resource.reload.name).to eq('changed_name') end it 'destroy a resource' do visit admin_conference_resources_path(conference.short_title) click_link('Delete', href: admin_conference_resource_path(conference.short_title, resource.id)) - page.find('#flash') - expect(flash).to eq('Resource successfully destroyed.') + within('#flash') { expect(page).to have_text('Resource successfully destroyed.') } end end end diff --git a/spec/features/roles_spec.rb b/spec/features/roles_spec.rb index dff041316..37618e945 100644 --- a/spec/features/roles_spec.rb +++ b/spec/features/roles_spec.rb @@ -20,10 +20,9 @@ click_link('Edit', href: edit_admin_conference_role_path(conference.short_title, role_name)) fill_in 'role_description', with: 'changed description' click_button 'Update Role' - role.reload - page.find('#flash') - expect(flash).to eq("Successfully updated role #{role_name}") - expect(role.description).to eq('changed description') + + within('#flash') { expect(page).to have_text("Successfully updated role #{role_name}") } + expect(role.reload.description).to eq('changed description') end end @@ -60,6 +59,8 @@ fill_in 'user_email', with: user_with_no_role.email click_button 'Add' + page.find('.alert') + user_with_no_role.reload expect(user_with_no_role.has_cached_role?(role.name, conference)).to be true @@ -104,52 +105,6 @@ end end - context 'organization_admin' do - let!(:organization) { create(:organization) } - let!(:org_admin_role) { Role.find_by(name: 'organization_admin', resource: organization) } - let!(:organization_admin) { create(:user, role_ids: [org_admin_role.id]) } - let(:user_with_no_role) { create(:user) } - let!(:other_organization) { create(:organization) } - - before do - sign_in organization_admin - visit admin_organizations_path - end - - context 'for the organization it belongs to' do - it 'successfully adds role organization_admin' do - click_link('Admins', href: admins_admin_organization_path(organization.id)) - - fill_in 'user_email', with: user_with_no_role.email - click_button 'Add' - user_with_no_role.reload - - expect(user_with_no_role.has_cached_role?('organization_admin', organization)).to be true - end - - it 'successfully removes role organization_admin' do - click_link('Admins', href: admins_admin_organization_path(organization.id)) - - first('tbody > tr').find('.btn-danger').click - organization_admin.reload - expect(organization_admin.has_cached_role?('organization_admin', organization)).to be false - end - end - - context 'for the organizations it does not belong to' do - it 'does not successfully add role organization_admin' do - click_link('Admins', href: admins_admin_organization_path(other_organization.id)) - - expect(page.has_field?('user_email')).to be false - end - - it 'does not successfully removes role organization_admin' do - click_link('Admins', href: admins_admin_organization_path(other_organization.id)) - expect(page.has_css?('.btn-danger')).to be false - end - end - end - context 'organizer' do Role.all.each.map(&:name).each do |role| it_behaves_like 'successfully', role, 'organizer' diff --git a/spec/features/rooms_spec.rb b/spec/features/rooms_spec.rb index 5a84c0c8c..091c7812e 100644 --- a/spec/features/rooms_spec.rb +++ b/spec/features/rooms_spec.rb @@ -23,9 +23,8 @@ fill_in 'room_size', with: '100' click_button 'Create Room' - page.find('#flash') - # Validations - expect(flash).to eq('Room successfully created.') + + within('#flash') { expect(page).to have_text('Room successfully created.') } within('table#rooms') do expect(page.has_content?('Auditorium')).to be true expect(page.assert_selector('tr', count: 2)).to be true @@ -43,9 +42,8 @@ fill_in 'room_size', with: '100' click_button 'Update Room' - page.find('#flash') - # Validations - expect(flash).to eq('Room successfully updated.') + + within('#flash') { expect(page).to have_text('Room successfully updated.') } within('table#rooms') do expect(page.has_content?('Auditorium')).to be true expect(page.assert_selector('tr', count: 2)).to be true diff --git a/spec/features/splashpage_spec.rb b/spec/features/splashpage_spec.rb index ed8ce86bf..189a64903 100644 --- a/spec/features/splashpage_spec.rb +++ b/spec/features/splashpage_spec.rb @@ -14,9 +14,9 @@ click_link 'Create Splashpage' click_button 'Save' - page.find('#flash') - expect(flash).to eq('Splashpage successfully created.') - expect(page).to have_current_path(admin_conference_splashpage_path(conference.short_title), ignore_query: true) + + within('#flash') { expect(page).to have_text('Splashpage successfully created.') } + expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) expect(page.has_text?('Private')).to be true end @@ -30,9 +30,9 @@ click_link 'Configure' check('Make splash page public') click_button 'Save' - page.find('#flash') - expect(flash).to eq('Splashpage successfully updated.') - expect(page).to have_current_path(admin_conference_splashpage_path(conference.short_title), ignore_query: true) + + within('#flash') { expect(page).to have_text('Splashpage successfully updated.') } + expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) expect(page.has_text?('Public')).to be true click_link 'Configure' @@ -44,9 +44,8 @@ visit admin_conference_splashpage_path(conference.short_title) click_link 'Delete' page.accept_alert - page.find('#flash') - expect(page).to have_current_path(admin_conference_splashpage_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Splashpage was successfully destroyed.') + expect(current_path).to eq(admin_conference_splashpage_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Splashpage was successfully destroyed.') } expect(Splashpage.count).to eq(0) end @@ -59,167 +58,8 @@ it 'splashpage is not accessible for participants if it is not public' do sign_in participant visit conference_path(conference.short_title) - page.find('#flash') - expect(flash).to eq('You are not authorized to access this page.') - expect(page).to have_current_path(root_path, ignore_query: true) - end - end - - context 'navigation' do - let!(:splashpage) { create(:splashpage, conference: conference, public: true) } - - context 'multiple organizations' do - let!(:additional_organization) { create(:organization) } - - it 'has organization logo', feature: true, js: true do - sign_in participant - visit conference_path(conference.short_title) - - expect(find('.navbar-brand img')['alt']).to have_content conference.organization.name - end - end - end - - context 'happening now section', feature: true, js: true do - let!(:conference2) do - create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now, start_hour: 0, end_hour: 24) - end - let!(:program) { conference2.program } - let!(:selected_schedule) { create(:schedule, program: program) } - let!(:splashpage) { create(:full_splashpage, conference: conference2, public: true) } - - let!(:scheduled_event1) do - program.update!(selected_schedule: selected_schedule) - create(:event, program: program, state: 'confirmed', abstract: '`markdown`') - end - let!(:scheduled_event2) do - program.update!(selected_schedule: selected_schedule) - create(:event, program: program, state: 'confirmed') - end - let!(:scheduled_event3) do - program.update!(selected_schedule: selected_schedule) - create(:event, program: program, state: 'confirmed') - end - let!(:scheduled_event4) do - program.update!(selected_schedule: selected_schedule) - create(:event, program: program, state: 'confirmed') - end - let!(:current_time) { Time.now.in_time_zone(conference2.timezone) } - - before do - sign_in participant - end - - it 'displays \'There are no upcoming events.\' if nothing is happening now and next' do - visit conference_path(conference2.short_title) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content('There are no upcoming events.') - end - - it 'shows all events happening next if nothing is happening now' do - event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - visit conference_path(conference2.short_title) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content(event_schedule1.event.title) - expect(happening_now).to have_content(event_schedule2.event.title) - end - - it 'only shows all events happening now if something is happening now and next' do - event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule3 = create(:event_schedule, event: scheduled_event3, schedule: selected_schedule, -start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S')) - visit conference_path(conference2.short_title) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content(event_schedule3.event.title) - expect(happening_now).not_to have_content(event_schedule1.event.title) - expect(happening_now).not_to have_content(event_schedule2.event.title) - end - - it 'only shows events happening at the earliest time, not at a later time in the future' do - event_schedule1 = create(:event_schedule, event: scheduled_event1, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule2 = create(:event_schedule, event: scheduled_event2, schedule: selected_schedule, -start_time: (current_time + 1.hour).strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule3 = create(:event_schedule, event: scheduled_event3, schedule: selected_schedule, -start_time: (current_time + 2.hours).strftime('%a, %d %b %Y %H:%M:%S')) - visit conference_path(conference2.short_title) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content(event_schedule1.event.title) - expect(happening_now).to have_content(event_schedule2.event.title) - expect(happening_now).not_to have_content(event_schedule3.event.title) - end - - it 'only shows 3 events happening now because of pagination' do - Rails.configuration.conference[:events_per_page] = 3 - event_schedule1 = create(:event_schedule, event: scheduled_event1, - schedule: selected_schedule, - start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule2 = create(:event_schedule, event: scheduled_event2, - schedule: selected_schedule, - start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule3 = create(:event_schedule, event: scheduled_event3, - schedule: selected_schedule, - start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S')) - event_schedule4 = create(:event_schedule, event: scheduled_event4, - schedule: selected_schedule, - start_time: current_time.strftime('%a, %d %b %Y %H:%M:%S')) - - visit conference_path(conference2.short_title) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content(event_schedule1.event.title) - expect(happening_now).to have_content(event_schedule2.event.title) - expect(happening_now).to have_content(event_schedule3.event.title) - expect(happening_now).not_to have_content(event_schedule4.event.title) - - visit conference_path(conference2.short_title, page: 2) - happening_now = page.find('#happening-now') - expect(happening_now).to have_content(event_schedule4.event.title) - end - end - - context 'clarify registration status' do - let!(:splashpage) { create(:splashpage, conference: conference, public: true) } - let!(:reg_ticket) { create(:ticket, registration_ticket: true, conference: conference) } - let!(:free_ticket) { create(:ticket, price_cents: 0) } - - it 'user signed in with no tickets', feature: true do - sign_in participant - visit conference_path(conference.short_title) - expect(page).to have_content 'You have not booked any tickets for this conference yet.' - end - - it 'user signed in with 1 free ticket', feature: true do - sign_in participant - create(:ticket_purchase, conference: conference, user: participant, ticket: free_ticket, quantity: 1) - visit conference_path(conference.short_title) - expect(page).not_to have_content 'You have not booked any tickets for this conference yet.' - end - - # TODO-SNAPCON: This should check for reg tickets, not just any ticket. - it 'user signed in with 1 paid ticket', feature: true do - sign_in participant - create(:ticket_purchase, conference: conference, user: participant, ticket: reg_ticket, quantity: 1) - visit conference_path(conference.short_title) - expect(page).not_to have_content 'You have not booked any tickets for this conference yet.' - end - - it 'user signed in with multiple ticket', feature: true do - sign_in participant - create(:ticket_purchase, conference: conference, user: participant, ticket: reg_ticket, quantity: 1) - create(:ticket_purchase, conference: conference, user: participant, ticket: free_ticket, quantity: 1) - visit conference_path(conference.short_title) - expect(page).not_to have_content 'You have not booked any tickets for this conference yet.' - end - - it 'user not signed in', feature: true do - visit conference_path(conference.short_title) - expect(page).not_to have_content 'You have not booked any tickets for this conference yet.' + within('#flash') { expect(page).to have_text('You are not authorized to access this page.') } + expect(current_path).to eq(root_path) end end end diff --git a/spec/features/sponsor_spec.rb b/spec/features/sponsor_spec.rb index 7f7277cea..860d0a1d2 100644 --- a/spec/features/sponsor_spec.rb +++ b/spec/features/sponsor_spec.rb @@ -26,8 +26,8 @@ select(conference.sponsorship_levels.first.title, from: 'sponsor_sponsorship_level_id') click_button 'Create Sponsor' - page.find('#flash') - expect(flash).to eq('Sponsor successfully created.') + + within('#flash') { expect(page).to have_text('Sponsor successfully created.') } within('table#sponsors') do expect(page.has_content?('SUSE')).to be true expect(page.has_content?('The original provider')).to be true @@ -46,9 +46,8 @@ click_link 'Delete' end end - page.find('#flash') - expect(flash).to eq('Sponsor successfully deleted.') - expect(page).not_to have_table('#sponsors') + within('#flash') { expect(page).to have_text('Sponsor successfully deleted.') } + expect(page).to have_no_selector('table#sponsors') end end diff --git a/spec/features/sponsorship_level_spec.rb b/spec/features/sponsorship_level_spec.rb index cb2803ce3..55fd419c2 100644 --- a/spec/features/sponsorship_level_spec.rb +++ b/spec/features/sponsorship_level_spec.rb @@ -21,9 +21,8 @@ fill_in 'sponsorship_level_title', with: 'Platin' click_button 'Create Sponsorship level' - page.find('#flash') - # Validations - expect(flash).to eq('Sponsorship level successfully created.') + + within('#flash') { expect(page).to have_text('Sponsorship level successfully created.') } within('table#sponsorship_levels') do expect(page.has_content?('Platin')).to be true expect(page.assert_selector('tr', count: 2)).to be true @@ -40,9 +39,8 @@ fill_in 'sponsorship_level_title', with: 'Gold' click_button 'Update Sponsorship level' - page.find('#flash') - # Validations - expect(flash).to eq('Sponsorship level successfully updated.') + + within('#flash') { expect(page).to have_text('Sponsorship level successfully updated.') } within('table#sponsorship_levels') do expect(page.has_content?('Gold')).to be true expect(page.assert_selector('tr', count: 2)).to be true diff --git a/spec/features/surveys_spec.rb b/spec/features/surveys_spec.rb index d80ae263f..48f589ffa 100644 --- a/spec/features/surveys_spec.rb +++ b/spec/features/surveys_spec.rb @@ -18,12 +18,12 @@ click_link 'New' fill_in 'Title', with: 'Example Survey' click_button 'Create Survey' - expect(flash).to eq('Successfully created survey') + within('#flash') { expect(page).to have_text('Successfully created survey') } fill_in :survey_question_title, with: 'Example question' select 'boolean', from: 'Type of Question:', visible: false # Hidden by bootstrap-select click_button 'Create Survey question' - expect(flash).to eq('Successfully created Survey Question.') + within('#flash') { expect(page).to have_text('Successfully created Survey Question.') } end end @@ -46,7 +46,7 @@ click_link survey.title choose 'Yes' click_button 'Submit' - expect(flash).to eq('Successfully responded to survey.') + within('#flash') { expect(page).to have_text('Successfully responded to survey.') } visit conference_conference_registration_path(conference) expect(find(:link, survey.title).sibling('.fa-solid')[:title]).to eq('Thank you for filling out the survey') diff --git a/spec/features/ticket_purchases_spec.rb b/spec/features/ticket_purchases_spec.rb index 32bb9fd1f..05d16f621 100644 --- a/spec/features/ticket_purchases_spec.rb +++ b/spec/features/ticket_purchases_spec.rb @@ -34,7 +34,8 @@ def make_failed_stripe_purchase end context 'as a participant' do - before do + + before(:each) do sign_in participant end @@ -55,18 +56,29 @@ def make_failed_stripe_purchase expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) click_button 'Continue' - page.find('#flash') - expect(page).to have_current_path(new_conference_payment_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Please pay here to get tickets.') + + expect(current_path).to eq(new_conference_payment_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Please pay here to get tickets.') } + purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first expect(purchase.quantity).to eq(2) - if ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key - make_stripe_purchase - # expect(current_path).to eq(conference_conference_registration_path(conference.short_title)) - expect(page).to have_current_path(conference_physical_tickets_path(conference.short_title), - ignore_query: true) - expect(page).to have_content 'Your ticket is booked successfully.' + if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil) + find('.stripe-button-el').click + + stripe_iframe = all('iframe[name=stripe_checkout_app]').last + sleep(5) + Capybara.within_frame stripe_iframe do + expect(page).to have_content('book your tickets') + page.execute_script(%{ $('input#card_number').val('4242424242424242'); }) + page.execute_script(%{ $('input#cc-exp').val('08/22'); }) + page.execute_script(%{ $('input#cc-csc').val('123'); }) + page.execute_script(%{ $('#submitButton').click(); }) + sleep(20) + end + + expect(current_path).to eq(conference_conference_registration_path(conference.short_title)) + expect(page.has_content?("2 #{ticket.title} Tickets for $ 10")).to be true end end @@ -82,17 +94,28 @@ def make_failed_stripe_purchase expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) click_button 'Continue' - page.find('#flash') - expect(page).to have_current_path(new_conference_payment_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Please pay here to get tickets.') + + expect(current_path).to eq(new_conference_payment_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Please pay here to get tickets.') } + purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first expect(purchase.quantity).to eq(2) - if ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key - make_failed_stripe_purchase - page.find('#flash') - expect(page).to have_current_path(conference_payments_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Your card was declined. Please try again with correct credentials.') + if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil) + find('.stripe-button-el').click + + stripe_iframe = all('iframe[name=stripe_checkout_app]').last + sleep(5) + Capybara.within_frame stripe_iframe do + expect(page).to have_content('book your tickets') + page.execute_script(%{ $('input#card_number').val('4000000000000341'); }) + page.execute_script(%{ $('input#cc-exp').val('08/22'); }) + page.execute_script(%{ $('input#cc-csc').val('123'); }) + page.execute_script(%{ $('#submitButton').click(); }) + sleep(20) + end + expect(current_path).to eq(conference_payments_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Your card was declined. Please try again with correct credentials.') } end end @@ -190,61 +213,9 @@ def make_failed_stripe_purchase expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) click_button 'Continue' - page.find('#flash') - expect(flash).to eq('Oops, something went wrong with your purchase! You cannot buy more than one registration tickets.') - expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) - end - end - - context 'currency conversion' do - before do - conference.currency_conversions << create(:currency_conversion, from_currency: 'USD', to_currency: 'EUR', rate: 0.89) - conference.currency_conversions << create(:currency_conversion, from_currency: 'USD', to_currency: 'GBP', rate: 0.75) - visit root_path - click_link 'Register' - click_button 'Register' - end - it 'selects a ticket in EUR', feature: true, js: true do - select 'EUR', from: 'currency_selector' - fill_in "tickets__#{third_registration_ticket.id}", with: '1' - expect(page).to have_content('17.80') - end - - it 'switches between EUR and GBP', feature: true, js: true do - select 'EUR', from: 'currency_selector' - fill_in "tickets__#{third_registration_ticket.id}", with: '1' - expect(page).to have_content('17.80') - select 'GBP', from: 'currency_selector' - expect(page).to have_content('7.50') - end - - it 'sees the correct currency symbol after changing the currency in tickets', feature: true, js: true do - select 'EUR', from: 'currency_selector' - expect(page).to have_content('€') - select 'GBP', from: 'currency_selector' - expect(page).to have_content('£') - end - - it 'buys a ticket in EUR' do - select 'EUR', from: 'currency_selector' - fill_in "tickets__#{third_registration_ticket.id}", with: '1' - expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) - click_button 'Continue' - page.find('#flash') - expect(page).to have_current_path(new_conference_payment_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Please pay here to get tickets.') - purchase = TicketPurchase.where(user_id: participant.id, ticket_id: third_registration_ticket.id).first - expect(purchase.quantity).to eq(1) - expect(purchase.currency).to eq('EUR') - expect(purchase.amount_paid).to eq(17.80) - - if ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key - make_stripe_purchase - expect(page).to have_current_path(new_conference_conference_registration_path(conference.short_title), - ignore_query: true) - expect(page).to have_content 'Your ticket is booked successfully.' - end + expect(current_path).to eq(conference_tickets_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Oops, something went wrong with your purchase! You cannot buy more than one registration tickets.') } end end @@ -262,18 +233,29 @@ def make_failed_stripe_purchase expect(page).to have_current_path(conference_tickets_path(conference.short_title), ignore_query: true) click_button 'Continue' - page.find('#flash') - expect(page).to have_current_path(new_conference_payment_path(conference.short_title), ignore_query: true) - expect(flash).to eq('Please pay here to get tickets.') + + expect(current_path).to eq(new_conference_payment_path(conference.short_title)) + within('#flash') { expect(page).to have_text('Please pay here to get tickets.') } + purchase = TicketPurchase.where(user_id: participant.id, ticket_id: ticket.id).first expect(purchase.quantity).to eq(2) - if ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key - make_stripe_purchase - # expect(current_path).to eq(conference_conference_registration_path(conference.short_title)) - expect(page).to have_current_path(conference_physical_tickets_path(conference.short_title), - ignore_query: true) - expect(page).to have_content 'Your ticket is booked successfully.' + if ENV.fetch('STRIPE_PUBLISHABLE_KEY', nil) + find('.stripe-button-el').click + + stripe_iframe = all('iframe[name=stripe_checkout_app]').last + sleep(5) + Capybara.within_frame stripe_iframe do + expect(page).to have_content('book your tickets') + page.execute_script(%{ $('input#card_number').val('4242424242424242'); }) + page.execute_script(%{ $('input#cc-exp').val('08/22'); }) + page.execute_script(%{ $('input#cc-csc').val('123'); }) + page.execute_script(%{ $('#submitButton').click(); }) + sleep(20) + end + + expect(current_path).to eq(conference_conference_registration_path(conference.short_title)) + expect(page.has_content?("2 #{ticket.title} Tickets for $ 10")).to be true click_button 'Unregister' end diff --git a/spec/features/tickets_spec.rb b/spec/features/tickets_spec.rb index ec3847c3c..e0ba7405f 100644 --- a/spec/features/tickets_spec.rb +++ b/spec/features/tickets_spec.rb @@ -24,8 +24,8 @@ fill_in 'ticket_price', with: '100' click_button 'Create Ticket' - page.find('#flash') - expect(flash).to eq('Ticket successfully created.') + + within('#flash') { expect(page).to have_text('Ticket successfully created.') } expect(Ticket.count).to eq(2) end @@ -72,14 +72,9 @@ click_button 'Update Ticket' - ticket.reload - # It's necessary to multiply by 100 because the price is in cents - page.find('#flash') - expect(flash).to eq('Ticket successfully updated.') - expect(ticket.price).to eq(Money.new(50 * 100, 'USD')) - expect(ticket.email_subject).to eq('Confirmation') - expect(ticket.email_body).to eq('Hi there! This email confirms that you made a business ticket purchase!') - expect(ticket.title).to eq('Event Ticket') + within('#flash') { expect(page).to have_text('Ticket successfully updated.') } + expect(ticket.reload.price.to_i).to eq(50) + expect(ticket.reload.title).to eq('Event Ticket') expect(Ticket.count).to eq(2) end @@ -105,8 +100,8 @@ visit admin_conference_tickets_path(conference.short_title) click_link('Delete', href: admin_conference_ticket_path(conference.short_title, ticket.id)) page.accept_alert - page.find('#flash') - expect(flash).to eq('Ticket successfully deleted.') + + within('#flash') { expect(page).to have_text('Ticket successfully destroyed.') } expect(Ticket.count).to eq(1) end end diff --git a/spec/features/track_organizer_ability_spec.rb b/spec/features/track_organizer_ability_spec.rb index 3f4690a4f..213eaa4e9 100644 --- a/spec/features/track_organizer_ability_spec.rb +++ b/spec/features/track_organizer_ability_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } +feature 'Has correct abilities' do + + let(:conference) { create(:full_conference) } let(:self_organized_track) { create(:track, :self_organized, program: conference.program, state: 'confirmed') } let(:role_track_organizer) { Role.where(name: 'track_organizer', resource: self_organized_track).first_or_create } let(:user_track_organizer) { create(:user, role_ids: [role_track_organizer.id]) } @@ -14,43 +14,38 @@ sign_in user_track_organizer end - it 'for organization and conference attributes' do + scenario 'for conference attributes' do visit admin_conference_path(conference.short_title) expect(page).to have_current_path(admin_conference_path(conference.short_title), ignore_query: true) expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).not_to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") + expect(page).to have_no_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit") expect(page).to have_text('Basics') - expect(page).not_to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") + expect(page).to have_no_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit") expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials") - expect(page).not_to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") - expect(page).not_to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") - expect(page).not_to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") - expect(page).not_to have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") + expect(page).to have_no_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage") + expect(page).to have_no_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue") + expect(page).to have_no_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms") + expect(page).to have_no_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings") expect(page).to have_link('Program', href: "/admin/conferences/#{conference.short_title}/program") - expect(page).not_to have_link('Call for Papers', - href: "/admin/conferences/#{conference.short_title}/program/cfps") + expect(page).to have_no_link('Call for Papers', href: "/admin/conferences/#{conference.short_title}/program/cfps") expect(page).to have_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events") expect(page).to have_link('Tracks', href: "/admin/conferences/#{conference.short_title}/program/tracks") - expect(page).not_to have_link('Event Types', - href: "/admin/conferences/#{conference.short_title}/program/event_types") - expect(page).not_to have_link('Difficulty Levels', - href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") + expect(page).to have_no_link('Event Types', href: "/admin/conferences/#{conference.short_title}/program/event_types") + expect(page).to have_no_link('Difficulty Levels', href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels") expect(page).to have_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules") expect(page).to have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports") - expect(page).not_to have_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") - expect(page).not_to have_link('Registration Period', - href: "/admin/conferences/#{conference.short_title}/registration_period") - expect(page).not_to have_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") - expect(page).not_to have_text('Donations') - expect(page).not_to have_link('Sponsorship Levels', - href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") - expect(page).not_to have_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") - expect(page).not_to have_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") - expect(page).not_to have_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") + expect(page).to have_no_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations") + expect(page).to have_no_link('Registration Period', href: "/admin/conferences/#{conference.short_title}/registration_period") + expect(page).to have_no_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions") + expect(page).to have_no_text('Donations') + expect(page).to have_no_link('Sponsorship Levels', href: "/admin/conferences/#{conference.short_title}/sponsorship_levels") + expect(page).to have_no_link('Sponsors', href: "/admin/conferences/#{conference.short_title}/sponsors") + expect(page).to have_no_link('Tickets', href: "/admin/conferences/#{conference.short_title}/tickets") + expect(page).to have_no_link('E-Mails', href: "/admin/conferences/#{conference.short_title}/emails") expect(page).to have_link('Roles', href: "/admin/conferences/#{conference.short_title}/roles") - expect(page).not_to have_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") - expect(page).not_to have_link('New Conference', href: '/admin/conferences/new') + expect(page).to have_no_link('Resources', href: "/admin/conferences/#{conference.short_title}/resources") + expect(page).to have_no_link('New Conference', href: '/admin/conferences/new') visit edit_admin_conference_path(conference.short_title) expect(page).to have_current_path root_path, ignore_query: true diff --git a/spec/features/tracks_spec.rb b/spec/features/tracks_spec.rb index 5311443c3..f899d1491 100644 --- a/spec/features/tracks_spec.rb +++ b/spec/features/tracks_spec.rb @@ -7,22 +7,21 @@ let!(:organizer) { create(:organizer, resource: conference) } let(:user) { create(:user) } - shared_examples 'admin tracks' do - it 'adds a track', feature: true, js: true do + describe 'organizer' do + scenario 'adds a track', feature: true, js: true do + sign_in organizer - expected = expect do + expect do visit admin_conference_program_tracks_path(conference_id: conference.short_title) click_link 'New Track' fill_in 'track_name', with: 'Distribution' fill_in 'track_short_name', with: 'Distribution' click_button 'Create Track' - page.find('#flash') - end + within('#flash') { expect(page).to have_text('Track successfully created.') } + end.to change { Track.count }.by 1 - expected.to change { Track.count }.by 1 - expect(flash).to eq('Track successfully created.') within('table#tracks') do expect(page.has_content?('Distribution')).to be true end @@ -37,8 +36,8 @@ click_link 'Delete' end page.accept_alert - page.find('#flash') - expect(flash).to eq('Track successfully deleted.') + + within('#flash') { expect(page).to have_text('Track successfully deleted.') } expect(page.has_css?('table#tracks')).to be false expect(page.has_content?(track.name)).to be false expect(Track.count).to eq(0) @@ -48,7 +47,7 @@ create(:track, program_id: conference.program.id) sign_in organizer - expected = expect do + expect do visit admin_conference_program_tracks_path(conference_id: conference.short_title) within('#tracks', visible: true) do click_link 'Edit' @@ -58,10 +57,9 @@ fill_in 'track_short_name', with: 'Distribution' fill_in 'track_description', with: 'Events about our Linux distribution' click_button 'Update Track' - page.find('#flash') - end - expected.not_to(change { Track.count }) - expect(flash).to eq('Track successfully updated.') + within('#flash') { expect(page).to have_text('Track successfully updated.') } + end.to_not(change { Track.count }) + within('table#tracks') do expect(page.has_content?('Distribution')).to be true expect(page.has_content?('Events about our Linux')).to be true @@ -69,11 +67,16 @@ end end - shared_examples 'non admin tracks' do - it 'adds a track', feature: true, js: true do + describe 'signed in user' do + before :each do + create(:cfp, cfp_type: 'tracks', program: conference.program) + end + + scenario 'adds a track', feature: true, js: true do + sign_in user - expected = expect do + expect do visit conference_program_tracks_path(conference_id: conference.short_title) click_link 'New Track request' @@ -82,11 +85,9 @@ fill_in 'track_description', with: 'Events about our Linux distribution' fill_in 'track_relevance', with: 'Maintainer of super awesome distribution' click_button 'Create Track' - page.find('#flash') - end + within('#flash') { expect(page).to have_text('Track request successfully created.') } + end.to change { Track.count }.by 1 - expected.to change { Track.count }.by 1 - expect(flash).to eq('Track request successfully created.') within('table#tracks') do expect(page.has_content?('Distribution')).to be true expect(page.has_content?('Events about our Linux dist...')).to be true @@ -97,17 +98,15 @@ track = create(:track, :self_organized, program_id: conference.program.id, submitter: user) sign_in user - expected = expect do + expect do visit conference_program_tracks_path(conference_id: conference.short_title) accept_confirm do click_link 'Withdraw' end - page.find('#flash') - end + within('#flash') { expect(page).to have_text("Track #{track.name} withdrawn.") } + end.to_not(change { Track.count }) - expected.not_to(change { Track.count }) - expect(flash).to eq("Track #{track.name} withdrawn.") within('table#tracks') do expect(page.has_content?(track.name)).to be true expect(page.has_link?('Re-Submit')).to be true @@ -118,7 +117,7 @@ create(:track, :self_organized, program_id: conference.program.id, submitter: user) sign_in user - expected = expect do + expect do visit conference_program_tracks_path(conference_id: conference.short_title) click_link 'Edit' @@ -126,27 +125,13 @@ fill_in 'track_short_name', with: 'Distribution' fill_in 'track_description', with: 'Events about our Linux distribution' click_button 'Update Track' - page.find('#flash') - end + within('#flash') { expect(page).to have_text('Track request successfully updated.') } + end.to_not(change { Track.count }) - expected.not_to(change { Track.count }) - expect(flash).to eq('Track request successfully updated.') within('table#tracks') do expect(page.has_content?('Distribution')).to be true expect(page.has_content?('Events about our Linux dist...')).to be true end end end - - describe 'organizer' do - it_behaves_like 'admin tracks' - end - - describe 'signed in user' do - before do - create(:cfp, cfp_type: 'tracks', program: conference.program) - end - - it_behaves_like 'non admin tracks' - end end diff --git a/spec/features/user_ability_spec.rb b/spec/features/user_ability_spec.rb index e1ac1ed7b..c2ca6e43b 100644 --- a/spec/features/user_ability_spec.rb +++ b/spec/features/user_ability_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe 'Has correct abilities' do - let(:organization) { create(:organization) } - let(:conference) { create(:full_conference, organization: organization) } # user is cfp +feature 'Has correct abilities' do + + let(:conference) { create(:full_conference) } # user is cfp let(:user) { create(:user) } context 'when user has no role' do @@ -14,9 +14,9 @@ it 'for administration views' do visit admin_conference_path(conference.short_title) - page.find('#flash') - expect(page).to have_current_path root_path, ignore_query: true - expect(flash).to eq 'You are not authorized to access this page.' + + expect(current_path).to eq root_path + within('#flash') { expect(page).to have_text('You are not authorized to access this page.') } end end end diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index a6bb12161..eee1fc949 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -15,7 +15,8 @@ end fill_in 'Name', with: 'Edited Name' click_button 'Update User' - expect(flash).to include('Updated Edited Name') + + within('#flash') { expect(page).to have_text('Updated Edited Name') } end end diff --git a/spec/features/venues_spec.rb b/spec/features/venues_spec.rb index 6ad6c5db3..46d57a6d8 100644 --- a/spec/features/venues_spec.rb +++ b/spec/features/venues_spec.rb @@ -25,9 +25,9 @@ with: 'Lorem ipsum dolor sit amet, consetetur' \ 'sadipscing elitr, sed diam nonumy eirmod tempor' click_button 'Create Venue' - page.find('#flash') - expect(flash) - .to eq('Venue was successfully created.') + + within('#flash') { expect(page).to have_text('Venue was successfully created.') } + venue = Conference.find(conference.id).venue expect(venue.name).to eq('Example University') expect(venue.street).to eq('Example Street 42') @@ -41,13 +41,12 @@ fill_in 'venue_website', with: 'www.example.com new' fill_in 'venue_description', with: 'new' click_button 'Update Venue' - page.find('#flash') - expect(flash) - .to eq('Venue was successfully updated.') - venue.reload - expect(venue.name).to eq('Example University new') - expect(venue.website).to eq('www.example.com new') - expect(venue.description).to eq('new') + + within('#flash') { expect(page).to have_text('Venue was successfully updated.') } + + expect(venue.reload.name).to eq('Example University new') + expect(venue.reload.website).to eq('www.example.com new') + expect(venue.reload.description).to eq('new') end end diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 861abcf08..cd413b8b1 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -13,7 +13,7 @@ sign_in organizer end - it 'display changes in contact', feature: true, versioning: true, js: true do + scenario 'displays changes', feature: true, versioning: true, js: true do visit edit_admin_conference_contact_path(conference.short_title) fill_in 'contact_email', with: 'example@example.com' fill_in 'contact_sponsor_email', with: 'sponsor@example.com' @@ -21,427 +21,9 @@ fill_in 'contact_googleplus', with: 'http:\\www.google.com' click_button 'Update Contact' - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} updated social tag, email, googleplus and sponsor email of contact details in conference #{conference.short_title}") - end - - it 'display changes in program', feature: true, versioning: true, js: true do - visit edit_admin_conference_program_path(conference.short_title) - fill_in 'program_rating', with: '4' - click_button 'Update Program' - - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} updated rating of program in conference #{conference.short_title}") - end - - it 'display changes in cfp', feature: true, versioning: true, js: true do - cfp.update(start_date: (Date.today + 1).strftime('%d/%m/%Y'), - end_date: (Date.today + 3).strftime('%d/%m/%Y')) - cfp_id = cfp.id - cfp.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new cfp for events with ID #{cfp_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated start date and end date of cfp for events with ID #{cfp_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted cfp for events with ID #{cfp_id} in conference #{conference.short_title}") - end - - it 'display changes in registration_period', feature: true, versioning: true, js: true do - registration_period = create(:registration_period, conference: conference) - registration_period.update(start_date: (Date.today + 1).strftime('%d/%m/%Y'), - end_date: (Date.today + 3).strftime('%d/%m/%Y')) - registration_period_id = registration_period.id - registration_period.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new registration period with ID #{registration_period_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated start date and end date of registration period with ID #{registration_period_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted registration period with ID #{registration_period_id} in conference #{conference.short_title}") - end - - it 'display changes in conference', feature: true, versioning: true, js: true do - new_conference = create(:conference, title: 'Test Conference') - organizer.add_role :organizer, new_conference - new_conference.update(title: 'New Con', short_title: 'NewCon') - - visit admin_revision_history_path - select '100', from: 'versionstable_length' - expect(page).to have_text('Someone (probably via the console) created new conference NewCon') - expect(page).to have_text('Someone (probably via the console) created new event type Talk in conference NewCon') - expect(page).to have_text('Someone (probably via the console) created new event type Workshop in conference NewCon') - expect(page).to have_text('Someone (probably via the console) updated title and short title of conference NewCon') - end - - it 'display changes in event_type', feature: true, versioning: true, js: true do - event_type = create(:event_type, program: conference.program, name: 'Discussion') - event_type.update(length: 90, maximum_abstract_length: 10_000) - event_type_id = event_type.id - event_type.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new event type Discussion with ID #{event_type_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated length and maximum abstract length of event type Discussion with ID #{event_type_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted event type Discussion with ID #{event_type_id} in conference #{conference.short_title}") - end - - it 'display changes in lodging', feature: true, versioning: true, js: true do - lodging = create(:lodging, conference: conference, name: 'Hotel XYZ') - lodging.update(description: 'Nice view,close to venue', website_link: 'http://www.example.com') - lodging_id = lodging.id - lodging.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new lodging Hotel XYZ with ID #{lodging_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated description and website link of lodging Hotel XYZ with ID #{lodging_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted lodging Hotel XYZ with ID #{lodging_id} in conference #{conference.short_title}") - end - - it 'display changes in conference role', feature: true, versioning: true, js: true do - visit edit_admin_conference_role_path(conference.short_title, 'cfp') - fill_in 'role_description', with: 'For the members of the call for papers team' - click_button 'Update Role' - - visit admin_revision_history_path(conference_id: conference.short_title) - expect(page).to have_text("#{organizer.name} updated description of role cfp in conference #{conference.short_title}") - end - - it 'display changes in room', feature: true, versioning: true, js: true do - venue = create(:venue, conference: conference) - room = create(:room, venue: venue, name: 'Auditorium') - room.update_attribute(:size, 120) - room_id = room.id - room.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new room Auditorium with ID #{room_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated size of room Auditorium with ID #{room_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted room Auditorium with ID #{room_id} in conference #{conference.short_title}") - end - - it 'display changes in sponsor', feature: true, versioning: true, js: true do - conference.sponsorship_levels << create_list(:sponsorship_level, 2, conference: conference) - sponsor = create(:sponsor, conference: conference, name: 'SUSE', -sponsorship_level: conference.sponsorship_levels.first) - sponsor.update(website_url: 'https://www.suse.com/company/history', - sponsorship_level: conference.sponsorship_levels.second) - sponsor.destroy - sponsor_id = sponsor.id - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new sponsor SUSE with ID #{sponsor_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated website url and sponsorship level of sponsor SUSE with ID #{sponsor_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted sponsor SUSE with ID #{sponsor_id} in conference #{conference.short_title}") - end - - it 'display changes in sponsorship_level', feature: true, versioning: true, js: true do - sponsorship_level = create(:sponsorship_level, conference: conference) - sponsorship_level.update_attribute(:title, 'Gold') - sponsorship_level_id = sponsorship_level.id - sponsorship_level.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new sponsorship level Gold with ID #{sponsorship_level_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated title of sponsorship level Gold with ID #{sponsorship_level_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted sponsorship level Gold with ID #{sponsorship_level_id} in conference #{conference.short_title}") - end - - it 'display changes in ticket', feature: true, versioning: true, js: true do - ticket = create(:ticket, conference: conference, title: 'Gold') - ticket.update(price: 50, description: 'Premium Ticket') - ticket_id = ticket.id - ticket.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new ticket Gold with ID #{ticket_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated description and price cents of ticket Gold with ID #{ticket_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted ticket Gold with ID #{ticket_id} in conference #{conference.short_title}") - end - - it 'display changes in track', feature: true, versioning: true, js: true do - track = create(:track, program: conference.program, name: 'Distribution') - track.update_attribute(:description, 'Events about Linux distributions') - track_id = track.id - track.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new track Distribution with ID #{track_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated description of track Distribution with ID #{track_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted track Distribution with ID #{track_id} in conference #{conference.short_title}") - end - - it 'display changes in venue', feature: true, versioning: true, js: true do - venue = create(:venue, conference: conference, name: 'Example University') - venue.update(website: 'www.example.com new', description: 'Just another beautiful venue') - venue_id = venue.id - venue.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new venue Example University with ID #{venue_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated website and description of venue Example University with ID #{venue_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted venue Example University with ID #{venue_id} in conference #{conference.short_title}") - end - - xit 'display changes in event', feature: true, versioning: true, js: true do - visit new_conference_program_proposal_path(conference_id: conference.short_title) - fill_in 'event_title', with: 'ABC' - fill_in 'event_abstract', with: 'Lorem ipsum abstract' - select('Talk - 30 min', from: 'event[event_type_id]') - click_button 'Create Proposal' - - click_link 'Edit' - fill_in 'event_subtitle', with: 'My event subtitle' - select('Easy', from: 'event[difficulty_level_id]') - click_button 'Update Proposal' - - visit admin_conference_program_events_path(conference.short_title) - click_on 'New' - click_link 'Reject' - - visit conference_program_proposals_path(conference_id: conference.short_title) - within('#events') do - click_link 'Re-Submit' - end - - visit admin_conference_program_events_path(conference.short_title) - click_on 'New' - click_link 'Accept' - - visit conference_program_proposals_path(conference_id: conference.short_title) - click_link 'Confirm' - - visit admin_conference_program_events_path(conference.short_title) - click_on 'Confirmed' - click_link 'Cancel' - - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} submitted new event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} updated subtitle and difficulty level of event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} rejected event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} resubmitted event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} accepted event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} confirmed event ABC in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} canceled event ABC in conference #{conference.short_title}") - end - - it 'display changes in difficulty levels', feature: true, versioning: true, js: true do - difficulty_level = create(:difficulty_level, program: conference.program, title: 'Expert') - difficulty_level.update_attribute(:description, 'Only for Experts') - difficulty_level_id = difficulty_level.id - difficulty_level.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new difficulty level Expert with ID #{difficulty_level_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated description of difficulty level Expert with ID #{difficulty_level_id} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted difficulty level Expert with ID #{difficulty_level_id} in conference #{conference.short_title}") - end - - it 'display changes in splashpages', feature: true, versioning: true, js: true do - visit admin_conference_splashpage_path(conference.short_title) - click_link 'Create Splashpage' - click_button 'Save' - - click_link 'Configure' - check('Display the program?') - check('Display call for papers and call for tracks?') - check('Display the venue?') - check('Display the tickets?') - check('Display the lodgings?') - check('Display the sponsors?') - check('Display the social media links?') - check('Make splash page public?') - click_button 'Save' - splashpage_id = conference.splashpage.id - - click_link 'Delete' - page.accept_alert - expect(page).to have_text('Splashpage was successfully destroyed') - - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} created new splashpage with ID #{splashpage_id} in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} updated public, include program, include social media, include venue, include tickets, include sponsors, include lodgings and include cfp of splashpage with ID #{splashpage_id} in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} deleted splashpage with ID #{splashpage_id} in conference #{conference.short_title}") - end - - it 'displays users subscribe/unsubscribe to conferences', feature: true, versioning: true, js: true do - visit root_path - click_link 'Subscribe' - click_link 'Unsubscribe' - PaperTrail::Version.last.reify.save! - PaperTrail::Version.last.item.destroy! - - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} subscribed to conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} unsubscribed from conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) subscribed #{organizer.name} to conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) unsubscribed #{organizer.name} from conference #{conference.short_title}") - end - - it 'display changes in conference commercials', feature: true, versioning: true, js: true do - conference_commercial = create(:conference_commercial, commercialable: conference) - conference_commercial.update_attribute(:url, 'https://www.youtube.com/watch?v=VNkDJk5_9eU') - conference_commercial.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new commercial in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated url of commercial in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted commercial in conference #{conference.short_title}") - end - - it 'display changes in event commercials', feature: true, versioning: true, js: true do - event_commercial - event_commercial.update_attribute(:url, 'https://www.youtube.com/watch?v=VNkDJk5_9eU') - event_commercial.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) created new commercial in event #{event_with_commercial.title} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated url of commercial in event #{event_with_commercial.title} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted commercial in event #{event_with_commercial.title} in conference #{conference.short_title}") - end - - it 'display changes in event commercials in event history', feature: true, versioning: true, js: true do - event_without_commercial = create(:event, program: conference.program) - event_commercial - - visit admin_conference_program_event_path(conference.short_title, event_with_commercial) - click_link 'History' - # TODO-SNAPCON: Figure out why this is here... - # expect(page).to have_text('Someone (probably via the console) created new commercial') - visit admin_conference_program_event_path(conference.short_title, event_without_commercial) - click_link 'History' - expect(page).to have_no_text('Someone (probably via the console) created new commercial') - end - - it 'display changes in organization', feature: true, versioning: true, js: true do - admin = create(:admin) - sign_in admin - - visit new_admin_organization_path - fill_in 'organization_name', with: 'New org' - click_button 'Create Organization' - - visit admin_revision_history_path - expect(page).to have_text('created new organization New org') - end - - context 'organization role', feature: true, versioning: true, js: true do - let!(:organization_admin) { create(:organization_admin, organization: conference.organization) } - let!(:user) { create(:user) } - - before do - user.add_role :organization_admin, conference.organization - user.remove_role :organization_admin, conference.organization - - sign_in organization_admin - visit admin_revision_history_path - end - - it 'is recorded to history when user is added' do - skip('fails since paper_trail 12.2.0') - expect(page).to have_text(/added role organization_admin with ID \d+ to user #{user.name} in organization #{conference.organization.name}/) - end - - it 'is recorded to history when user is removed' do - skip('fails since paper_trail 12.2.0') - expect(page).to have_text(/removed role organization_admin with ID \d+ from user #{user.name} in organization #{conference.organization.name}/) - end - end - - it 'display changes in users_role for conference role', feature: true, versioning: true, js: true do - user = create(:user) - role = Role.find_by(name: 'cfp', resource_id: conference.id, resource_type: 'Conference') - user.add_role :cfp, conference - user_role = UsersRole.find_by(user_id: user.id, role_id: role.id) - user.remove_role :cfp, conference + within('#flash') { expect(page).to have_text('Contact details were successfully updated.') } visit admin_revision_history_path - expect(page).to have_text("added role cfp with ID #{user_role.id} to user #{user.name} in conference #{conference.short_title}") - expect(page).to have_text("removed role cfp with ID #{user_role.id} from user #{user.name} in conference #{conference.short_title}") - end - - it 'display changes in email settings', feature: true, versioning: true, js: true do - conference.email_settings.update(registration_subject: 'xxxxx', registration_body: 'yyyyy', - accepted_subject: 'zzzzz') - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) updated registration body, registration subject and accepted subject of email settings in conference #{conference.short_title}") - end - - it 'display changes in conference registrations', feature: true, versioning: true, js: true do - Registration.create(user: organizer, conference: conference) - Registration.last.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) registered #{organizer.name} to conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) unregistered #{organizer.name} from conference #{conference.short_title}") - end - - it 'display changes in event registration', feature: true, versioning: true, js: true do - create(:event, program: conference.program, title: 'My first event') - registration = Registration.create(user: organizer, conference: conference) - event = create(:event, program: conference.program, title: 'My second event') - EventsRegistration.create(registration: registration, event: event) - EventsRegistration.first.update_attribute(:attended, true) - EventsRegistration.last.destroy - # Here registration is deleted to ensure the event registration related change still displays the associated user's name - registration.destroy - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) registered #{organizer.name} to event My second event in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) updated attended of #{organizer.name}'s registration for event #{event.title} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) unregistered #{organizer.name} from event #{event.title} in conference #{conference.short_title}") - end - - it 'display changes in comment', feature: true, versioning: true, js: true do - create(:event, program: conference.program, title: 'My first event') - event = create(:event, program: conference.program, title: 'My second event') - visit admin_conference_program_event_path(conference_id: conference.short_title, id: event.id) - click_link 'Show' - fill_in 'comment_body', with: 'Sample comment' - click_button 'Save Comment' - expect(page).to have_text('Comments (1)') - Comment.last.destroy - PaperTrail::Version.last.reify.save - - visit admin_revision_history_path - expect(page).to have_text("#{organizer.name} commented on event My second event in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted #{organizer.name}'s comment on event #{event.title} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) re-added #{organizer.name}'s comment on event #{event.title} in conference #{conference.short_title}") - end - - it 'display changes in vote', feature: true, versioning: true, js: true do - conference.program.rating = 1 - create(:event, program: conference.program, title: 'My first event') - event = create(:event, program: conference.program, title: 'My second event') - create(:vote, user: organizer, event: event) - Vote.last.destroy - PaperTrail::Version.last.reify.save - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) voted on event My second event in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) deleted #{organizer.name}'s vote on event #{event.title} in conference #{conference.short_title}") - expect(page).to have_text("Someone (probably via the console) re-added #{organizer.name}'s vote on event #{event.title} in conference #{conference.short_title}") - end - - it 'display password reset requests', feature: true, versioning: true, js: true do - user = create(:user) - user.send_reset_password_instructions - - visit admin_revision_history_path - expect(page).to have_text("Someone requested password reset of user #{user.name}") - end - - it 'display user signups', feature: true, versioning: true, js: true do - create(:user, name: 'testname') - - visit admin_revision_history_path - expect(page).to have_text('testname signed up') - end - - it 'display updates to user', feature: true, versioning: true, js: true do - user = create(:user) - user.update(nickname: 'testnick', affiliation: 'openSUSE') - - visit admin_revision_history_path - expect(page).to have_text("Someone (probably via the console) updated nickname and affiliation of user #{user.name}") + expect(page).to have_text("#{organizer.name} updated social tag, email, googleplus and sponsor email of contact details in conference #{conference.short_title}") end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 808a2827d..f77592b90 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -70,27 +70,6 @@ ENV.delete('OSEM_NAME') expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: 'OSEM') end - - it 'uses the conference organization name' do - expect(nav_root_link_for(conference)).to include image_tag(conference.picture.thumb.url, - alt: conference.organization.name) - end - end - - describe 'navigation link title text' do - it 'defaults to OSEM' do - ENV.delete('OSEM_NAME') - expect(nav_link_text(nil)).to match 'OSEM' - end - - it 'uses the environment variable' do - ENV['OSEM_NAME'] = Faker::Company.name + "'" - expect(nav_link_text(nil)).to match ENV.fetch('OSEM_NAME', nil) - end - - it 'uses the conference organization name' do - expect(nav_link_text(conference)).to match conference.organization.name - end end end @@ -136,18 +115,11 @@ end describe '#conference_logo_url' do - let(:organization) { create(:organization) } - let(:conference2) { create(:conference, organization: organization) } + let(:conference2) { create(:conference) } it 'gives the correct logo url' do expect(conference_logo_url(conference2)).to eq('snapcon_logo.png') - File.open('spec/support/logos/1.png') do |file| - organization.picture = file - end - - expect(conference_logo_url(conference2)).to include(organization.picture.thumb.url) - File.open('spec/support/logos/2.png') do |file| conference2.picture = file end diff --git a/spec/mailers/mailbot_spec.rb b/spec/mailers/mailbot_spec.rb index 33a932236..ce91acf4a 100644 --- a/spec/mailers/mailbot_spec.rb +++ b/spec/mailers/mailbot_spec.rb @@ -40,7 +40,7 @@ end describe '.registration_mail' do - include_examples 'mailer actions' do + it_behaves_like 'mailer actions' do let(:mail) { Mailbot.registration_mail(conference, user).deliver_now } end end @@ -52,7 +52,7 @@ accepted_body: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit') end - include_examples 'mailer actions' do + it_behaves_like 'mailer actions' do let(:mail) { Mailbot.acceptance_mail(event).deliver_now } end end @@ -64,7 +64,7 @@ rejected_body: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit') end - include_examples 'mailer actions' do + it_behaves_like 'mailer actions' do let(:mail) { Mailbot.rejection_mail(event).deliver_now } end end @@ -76,7 +76,7 @@ confirmed_without_registration_body: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit') end - include_examples 'mailer actions' do + it_behaves_like 'mailer actions' do let(:mail) { Mailbot.confirm_reminder_mail(event).deliver_now } end end diff --git a/spec/models/conference_spec.rb b/spec/models/conference_spec.rb index e96d69fac..435a80f6c 100644 --- a/spec/models/conference_spec.rb +++ b/spec/models/conference_spec.rb @@ -30,12 +30,9 @@ # use_vpositions :boolean default(FALSE) # created_at :datetime # updated_at :datetime -# organization_id :integer # # Indexes # -# index_conferences_on_organization_id (organization_id) -# require 'spec_helper' context 'Delegation' do diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb deleted file mode 100644 index 9006b5546..000000000 --- a/spec/models/organization_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# == Schema Information -# -# Table name: organizations -# -# id :bigint not null, primary key -# code_of_conduct :text -# description :text -# name :string not null -# picture :string -# -require 'spec_helper' - -describe Organization do - let(:organization) { create(:organization) } - - describe 'validation' do - xit 'is not valid without a name' do - expect(subject).to validate_presence_of(:name) - end - end - - describe 'associations' do - xit { is_expected.to have_many(:conferences).dependent(:destroy) } - end -end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 151acca47..e4055fd26 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -351,44 +351,6 @@ end end - describe '#registered' do - context 'user has not registered to any conference' do - it 'returns None' do - expect(user.registered).to eq 'None' - end - end - - context 'user has registered to conferences' do - before do - create(:registration, user: user, conference: conference) - create(:registration, user: user, conference: conference2) - end - - it 'returns registered conferences title' do - expect(user.registered).to eq('openSUSE Conference 2016, openSUSE Conference 2015') - end - end - end - - describe '#attended' do - context 'user has not attended any conference' do - it 'returns None' do - expect(user.attended).to eq 'None' - end - end - - context 'user has attended conferences' do - before do - create(:registration, user: user, conference: conference, attended: true) - create(:registration, user: user, conference: conference2, attended: true) - end - - it 'returns attended conferences title' do - expect(user.attended).to eq('openSUSE Conference 2016, openSUSE Conference 2015') - end - end - end - describe '#confirmed?' do context 'confirmed user' do it 'returns true' do diff --git a/spec/serializers/conference_serializer_spec.rb b/spec/serializers/conference_serializer_spec.rb index 9931bc72f..1cbbdefca 100644 --- a/spec/serializers/conference_serializer_spec.rb +++ b/spec/serializers/conference_serializer_spec.rb @@ -30,12 +30,9 @@ # use_vpositions :boolean default(FALSE) # created_at :datetime # updated_at :datetime -# organization_id :integer # # Indexes # -# index_conferences_on_organization_id (organization_id) -# require 'spec_helper' describe ConferenceSerializer, type: :serializer do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 99a75f488..9771729e4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,7 @@ # run twice. It is recommended that you do not name files matching this glob to # end with _spec.rb. You can configure this pattern with with the --pattern # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } +Rails.root.glob('spec/support/**/*.rb').each { |f| require f } RSpec.configure do |config| # ## Mock Framework @@ -93,7 +93,6 @@ config.include OmniauthMacros config.include Devise::Test::ControllerHelpers, type: :controller config.include LoginMacros, type: :feature - config.include Flash, type: :feature config.include Sidebar, type: :view config.include Devise::Test::ControllerHelpers, type: :view @@ -122,6 +121,12 @@ @request.host = Rails.application.routes.default_url_options[:host] end + config.before(:each) do + Rails.logger.debug '======================================================================' + Rails.logger.debug { "\n\n\n\t\t#{RSpec.current_example.metadata[:full_description]}\n\n\n" } + Rails.logger.debug '======================================================================' + end + # use the config to use # t('some.locale.key') instead of always having to type I18n.t config.include AbstractController::Translation diff --git a/spec/support/external_request.rb b/spec/support/external_request.rb index 6fd7af57f..b4d3df0cc 100644 --- a/spec/support/external_request.rb +++ b/spec/support/external_request.rb @@ -2,6 +2,7 @@ # Mock external requests to youtube require 'webmock/rspec' + driver_urls = Webdrivers::Common.subclasses.map do |driver| Addressable::URI.parse(driver.base_url).host end diff --git a/spec/support/flash.rb b/spec/support/flash.rb deleted file mode 100644 index bcc9e9a9b..000000000 --- a/spec/support/flash.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module Flash - def flash - results = all(:css, 'div#flash p') - return 'none' if results.empty? - - if results.count > 1 - texts = results.map { |r| r.text } - raise "One flash expected, but we had #{texts.inspect}" - end - results.first.text - end -end diff --git a/spec/support/login_macros.rb b/spec/support/login_macros.rb index 7557c14df..962375124 100644 --- a/spec/support/login_macros.rb +++ b/spec/support/login_macros.rb @@ -2,6 +2,7 @@ module LoginMacros include Warden::Test::Helpers + Warden.test_mode! def sign_in(user) diff --git a/spec/support/save_feature_failures.rb b/spec/support/save_feature_failures.rb index 66aa399f8..20b2496f2 100644 --- a/spec/support/save_feature_failures.rb +++ b/spec/support/save_feature_failures.rb @@ -7,6 +7,7 @@ example_filename = File.expand_path(example_filename, Capybara.save_path) example_screenshotname = "#{example_filename}.png" example_filename += '.html' + # rubocop:disable Lint/Debugger if RSpec.current_example.exception.present? save_page(example_filename) save_screenshot(example_screenshotname) @@ -15,5 +16,6 @@ FileUtils.rm_rf(example_filename) FileUtils.rm_rf(example_screenshotname) end + # rubocop:enable Lint/Debugger end end diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb new file mode 100644 index 000000000..2b190325d --- /dev/null +++ b/spec/support/webmock.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# Allow webdriver update urls +# from https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock +allowed_urls = Webdrivers::Common.subclasses.map(&:base_url) +allowed_urls << /geckodriver/ +# We've seen [a redirect](https://github.com/titusfortner/webdrivers/issues/204) to this domain +allowed_urls += ['github-releases.githubusercontent.com'] +allowed_urls += ['googlechromelabs.github.io'] +allowed_urls += ['storage.googleapis.com'] + +# Allow stripe.com for stripe integration tests +allowed_urls += ['stripe.com'] + +WebMock.disable_net_connect!(allow_localhost: true, allow: allowed_urls)