Skip to content

Commit

Permalink
Add github workflow to rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
LksNuns committed Oct 10, 2024
1 parent dd4fcab commit 33e889d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ jobs:
- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager

scan_js:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -35,10 +34,10 @@ jobs:
ruby-version: .ruby-version
bundler-cache: true

- name: Scan for security vulnerabilities in JavaScript dependencies
run: bin/importmap audit
- name: Lint code for consistent style
run: bin/rubocop -f github

lint:
rspec:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: RSpec Tests

on:
pull_request:
push:
branches: [ master ]

jobs:gi
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Set up Database
run: |
bin/rails db:create RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=test
- name: Run specs
run: bundle exec rspec
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]

# "info" includes generic and useful information about system operation, but avoids logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/pay_rates/payments/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
request

expect(response).to have_http_status(:ok)
expect(JSON.parse(response.body)).to eq({ 'payment' => '15.0' })
expect(JSON.parse(response.body)).to eq({ 'payment' => 15.0 })
end
end

Expand Down
1 change: 0 additions & 1 deletion spec/requests/pay_rates/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@
end
end
end

0 comments on commit 33e889d

Please sign in to comment.