Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller Methods Not Being Covered by Tests #568

Closed
bjigarjian opened this issue Apr 3, 2017 · 2 comments
Closed

Controller Methods Not Being Covered by Tests #568

bjigarjian opened this issue Apr 3, 2017 · 2 comments

Comments

@bjigarjian
Copy link

bjigarjian commented Apr 3, 2017

I've been having this issue where simplecov does not cover code inside of my controller methods. My group has been working on this problem for weeks and no one has been able to figure out what is wrong. Our models are getting covered, but the methods inside of controllers are not working even though we have many tests that should cover these methods. Any suggestions are welcome.

Here is the gem in my Gemfile.
gem 'simplecov', :require => false, :group => :test

I am using Rails 4.2.6 with ruby 2.3.1

I am using the testing framework that comes with rails. To run my tests I run
bundle exec rake test.
Simplecov is required at the top of my Rakefile. My test_helper is below:

if ENV['RAILS_ENV'] == 'test'
  require 'simplecov'
  SimpleCov.start 'rails' do
    add_filter "/users/"
  end
  puts "required simplecov"
end

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  fixtures :all

  # Add more helper methods to be used by all tests here...

end

Thanks for helping.

@bf4
Copy link
Collaborator

bf4 commented Apr 15, 2017

Are you sure simplecov is started before any application code is required/loaded?

related: #340

@PragTob
Copy link
Collaborator

PragTob commented Aug 12, 2017

Closing due to no further feedback

@PragTob PragTob closed this as completed Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants