Skip to content

Commit

Permalink
Demo: commit untested code
Browse files Browse the repository at this point in the history
  • Loading branch information
grodowski committed Jan 23, 2024
1 parent c97f595 commit 8889f0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Rails Unit Tests
on: [push, pull_request]
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
class ApplicationController < ActionController::Base
def check_cookie
if params[:x] != ENV.fetch("CODE", "beta")
redirect_to(bounce_home_index_url) and return
end

cookies[:beta_sign_in] = { value: 1, expires: 1.year }
end

Check warning on line 8 in app/controllers/application_controller.rb

View check run for this annotation

UndercoverCI / coverage

Untested instance method

Instance method `check_cookie` is missing coverage for lines 3..4,7 (node coverage: 0.0). Missing branch coverage found in line 3.
Raw output
2:   def check_cookie hits: n/a
3:     if params[:x] != ENV.fetch("CODE", "beta") hits: 0 branches: 0/2
4:       redirect_to(bounce_home_index_url) and return hits: 0
5:     end hits: n/a
6: 
7:     cookies[:beta_sign_in] = { value: 1, expires: 1.year } hits: 0
8:   end hits: n/a

private

def check_beta_cookie
Expand Down

0 comments on commit 8889f0b

Please sign in to comment.