Skip to content

Commit

Permalink
fix up failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dereke committed Aug 20, 2021
1 parent f41ce4d commit cbee536
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .exrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
let g:vigun_extra_keywords = ['test']
let g:vigun_test_keywords = ['test', 'it', 'context', 'describe']
let g:vjs_tags_enabled = 0

let g:vigun_commands = [
fun! s:watch(cmd)
return "rg --files | entr -r -c sh -c 'echo ".escape('"'.a:cmd.'"', '"')." && ".a:cmd."'"
endf

let g:vigun_mappings = [
\ {
\ 'pattern': 'test/.*_test.rb$',
\ 'all': 'rails test #{file}',
\ 'nearest': 'rails test #{file}:#{line}',
\ 'watch-all': s:watch('rails test #{file}'),
\ 'watch-nearest': s:watch('rails test #{file}:#{line}'),
\ },
\ {
\ 'pattern': 'test/.*_test.rb$',
\ 'normal': 'rails test',
\ 'debug': 'BACKTRACE=1 rails test',
\ 'pattern': 'test/javascript/.*_test.js$',
\ 'all': 'yarn test #{file}',
\ 'nearest': 'yarn test --fgrep #{nearest_test} #{file}',
\ 'debug-all': 'yarn test --interactive #{file}',
\ 'debug-nearest': 'yarn test --interactive --fgrep #{nearest_test} #{file}',
\ }
\]

command! -nargs=0 Fixturex :cexpr system('./bin/fixturex.rb '. expand('%:t:r') .' '.shellescape(expand('<cword>'))) | copen

" open report fixture in a split to the right
" nnoremap gj :exec "botright vnew
" test/fixtures/reports/".expand('<cword>').".json"<cr>
2 changes: 2 additions & 0 deletions app/controllers/initiatives_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# rubocop:disable Metrics/ClassLength
class InitiativesController < ApplicationController
include ApplicationHelper

before_action :set_initiative, only: %i[edit update]
before_action :set_edit_data, only: %i[edit new create update]
skip_before_action :authenticate_user!, only: %i[index show]
Expand Down
1 change: 1 addition & 0 deletions test/models/initiative_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class InitiativeTest < ActiveSupport::TestCase
def expected_initiative_attributes
[
{
id: Initiative.first.id,
name: 'The Fruit Exchange',
description_what: 'Connecting people with surplus food',
description_how: 'Bringing food to the people',
Expand Down

0 comments on commit cbee536

Please sign in to comment.