Skip to content

Commit

Permalink
- ESY-6479 Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lilja committed Mar 26, 2024
1 parent d2e80ff commit 10412e5
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 1,002 deletions.
124 changes: 43 additions & 81 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-02-10 17:04:48 UTC using RuboCop version 1.44.1.
# on 2024-03-26 11:13:57 UTC using RuboCop version 1.62.1.
# 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
Expand All @@ -9,30 +9,28 @@
# Offense count: 1
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# AllowedGems: bundler
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'spec/fixture/Gemfile'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'swedbank-pay-design-guide-jekyll-theme.gemspec'

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'swedbank-pay-design-guide-jekyll-theme.gemspec'

# Offense count: 5
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/sidebar_after_payment_spec.rb'
- 'spec/sidebar_checkin_file_spec.rb'
- 'spec/sidebar_front_page_spec.rb'
- 'spec/sidebar_super_secret_file_spec.rb'

# Offense count: 6
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
# Offense count: 7
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 29

Expand All @@ -42,12 +40,12 @@ Metrics/ClassLength:
Max: 135

# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 9

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 10

Expand All @@ -68,78 +66,35 @@ RSpec/ContextWording:
- 'spec/spec_helper.rb'

# Offense count: 3
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- '**/spec/features/**/*'
- '**/spec/requests/**/*'
- '**/spec/routing/**/*'
- '**/spec/system/**/*'
- '**/spec/views/**/*'
- 'spec/card_checkout_core_features_spec.rb'
- 'spec/card_overview_spec.rb'
- 'spec/sidebar_spec.rb'

# Offense count: 25
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 25

# Offense count: 16
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Enabled: false
Exclude:
- 'spec/read_time_filter_spec.rb'
- 'spec/regex_capture_filter.spec'
- 'spec/rspec_description_parser_spec.rb'

# Offense count: 15
# Offense count: 1
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/card_checkout_core_features_spec.rb'
- 'spec/card_overview_spec.rb'
- 'spec/sidebar_after_payment_spec.rb'
- 'spec/sidebar_checkin_file_spec.rb'
- 'spec/sidebar_checkout_core_features_file_spec.rb'
- 'spec/sidebar_checkout_more_file_spec.rb'
- 'spec/sidebar_features_file_spec.rb'
- 'spec/sidebar_front_page_spec.rb'
- 'spec/sidebar_index_file_spec.rb'
- 'spec/sidebar_po_file_spec.rb'
- 'spec/sidebar_redirect_file_spec.rb'
- 'spec/sidebar_resource_file_spec.rb'
- 'spec/sidebar_search_file_spec.rb'
- 'spec/sidebar_super_secret_file_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 2
RSpec/MultipleExpectations:
Max: 2
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- '**/spec/routing/**/*'
- 'spec/read_time_filter_spec.rb'
- 'spec/rspec_description_parser_spec.rb'

# Offense count: 43
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
# Offense count: 1
# Configuration parameters: Include.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/SpecFilePathSuffix:
Exclude:
- 'spec/card_checkout_core_features_spec.rb'
- 'spec/card_overview_spec.rb'
- 'spec/sidebar_after_payment_spec.rb'
- 'spec/sidebar_checkin_file_spec.rb'
- 'spec/sidebar_checkout_core_features_file_spec.rb'
- 'spec/sidebar_checkout_more_file_spec.rb'
- 'spec/sidebar_features_file_spec.rb'
- 'spec/sidebar_front_page_spec.rb'
- 'spec/sidebar_index_file_spec.rb'
- 'spec/sidebar_po_file_spec.rb'
- 'spec/sidebar_redirect_file_spec.rb'
- 'spec/sidebar_resource_file_spec.rb'
- 'spec/sidebar_search_file_spec.rb'
- 'spec/sidebar_spec.rb'
- 'spec/sidebar_super_secret_file_spec.rb'

# Offense count: 13
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 7
- 'spec/regex_capture_filter.spec'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Expand All @@ -149,15 +104,22 @@ Style/CaseEquality:
- 'lib/sidebar_html_builder.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'spec/card_checkout_core_features_spec.rb'
- 'lib/sidebar_tree_builder.rb'

# Offense count: 8
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantCurrentDirectoryInPath:
Exclude:
- 'swedbank-pay-design-guide-jekyll-theme.gemspec'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 142
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ the changes in the browser after a refresh, just like normal.
When the theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled. To add a custom directory to your
theme-gem, please edit the regexp in `swedbankpay.gemspec` accordingly.


### Docker (recommended)

1. [Clone this repository][clone].
2. [Install Docker Personal][docker]. Select default settings when prompted.
3. Open a console window at the root of the repository and run `docker-compose up`.
This will create a docker container and spin it up with everything that's specified in the repository gemfile.
4. Open `http://localhost:4000` in a browser.


### Manual install

Expand All @@ -45,19 +43,17 @@ theme-gem, please edit the regexp in `swedbankpay.gemspec` accordingly.
that.
Note: If you're installing on Windows, choose Ruby+Devkit Installers.
4. Open VSC and open the repository
5. Verify that Git is installed by running `git status` in VSC terminal.
5. Verify that Git is installed by running `git status` in VSC terminal.
If Git is not properly installed, you will see an error message like the one below. Just [download Git][git] and install.
![Alt text](image.png)
6. Type `bundle install` inside the root folder of this repository.
7. Run `bundle exec jekyll serve` to start the website.
8. Open in a browser.


### Visual Studio Code plugins

You might want to install plugins for Graphviz, JSON, Liquid, Markdown and Mermaid as this will enhance your coding experience.


## Contributing

Bug reports and pull requests are welcome on [GitHub][github]. This project is
Expand All @@ -82,15 +78,11 @@ agreement][cla].
[design-guide]: <https://design.swedbankpay.com/>
[developer-portal]: <https://developer.swedbankpay.com/>
[docker]: <https://www.docker.com/>
[gems]: <https://rubygems.org/>
[git]: <https://git-scm.com/downloads>
[github]: <https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme>
[graphviz]: <https://graphviz.org/download/>
[license-badge]: https://img.shields.io/github/license/SwedbankPay/swedbank-pay-design-guide-jekyll-theme
[license]: <https://opensource.org/licenses/MIT>
[liquid]: <https://jekyllrb.com/docs/liquid/>
[opengraph-image]: <https://repository-images.githubusercontent.com/209270355/36818080-53ee-11ea-896c-082addb851a6>
[ruby]: <https://rubyinstaller.org/downloads/archives>
[swedbankpay]: <https://swedbankpay.github.io/swedbank-pay-design-guide-jekyll-theme/>
[test-badge]: <https://github.com/SwedbankPay/swedbank-pay-design-guide-jekyll-theme/workflows/Test/badge.svg>
[vsc-ruler]: <https://stackoverflow.com/questions/29968499/vertical-rulers-in-visual-studio-code>
9 changes: 1 addition & 8 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,7 @@ Content-Type: application/json'
"vatAmount": 0,
"description": "Test transaction",
"payeeReference": "1583846100",
"isOperational": true,
"operations": [
{
"method": "GET",
"href": "https://api.stage.payex.com/psp/creditcard/confined/payments/authorizations/authenticate/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"rel": "redirect-authentication"
}
]
"isOperational": true
}
}
}'
Expand Down
2 changes: 1 addition & 1 deletion lib/sidebar_html_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def sub_items_markup(page, current_page)

"<ul class=\"#{page.level.zero? ? 'secondary-nav-ul' : ''}\">
#{if page.level.positive? && page.children?
"<a href=\"../\" class=\"previous-nav\">
"<a href=\"#{page.path}..\" title=\"test4\" class=\"previous-nav\">
<i class=\"material-icons\" aria-hidden=\"true\">arrow_back_ios</i>
<span>Back to #{page.parent.title}</span>
</a>
Expand Down
50 changes: 0 additions & 50 deletions spec/card_checkout_core_features_spec.rb

This file was deleted.

Loading

0 comments on commit 10412e5

Please sign in to comment.