Skip to content

Instantly share code, notes, and snippets.

@ghigt
Created July 22, 2013 13:40
Show Gist options
  • Select an option

  • Save ghigt/6053886 to your computer and use it in GitHub Desktop.

Select an option

Save ghigt/6053886 to your computer and use it in GitHub Desktop.
Problems with tests

In test/functionals/groups_controller_test.rb:

should 'be able to add group without groupname' do
  Assignment.any_instance.stubs(:add_group).returns(Grouping.make)
  post_as @admin,
    :add_group,
    :assignment_id => @assignment.id
  [...]
end

In lib/benchmarking/submission_files/groups_controller.rb:

def add_group
  puts '-----'
  [...]
end

Run:

$ bundle exec ruby -Itest test/functional/groups_controller_test.rb
Loaded suite test/functional/groups_controller_test
Started
.............FF..........................................
Finished in 10.079021 seconds.

  1) Failure:
test: An authenticated and authorized admin doing a POST on :add_group should be able to add group without groupname. (GroupsControllerTest) [test/functional/groups_controller_test.rb:118]:
<nil> expected to not be nil.

  2) Failure:
test: An authenticated and authorized admin doing a POST on :add_group should be able to create with groupname. (GroupsControllerTest) [test/functional/groups_controller_test.rb:128]:
<nil> expected to not be nil.

57 tests, 203 assertions, 2 failures, 0 errors

There is no '----' ?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment