Skip to content

Commit

Permalink
Merge pull request #78 from bigbinary/coverage
Browse files Browse the repository at this point in the history
Improve Coverage and add Coveralls
  • Loading branch information
prathamesh-sonpatki committed May 28, 2015
2 parents 9e59948 + 080f57e commit 5244fbd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ group :test do

# for test coverage report
gem 'simplecov', require: false

end

# Attach comments to Active Record queries
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/email_interceptor.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if Settings.intercept_and_forward_emails_to.present?
options = { forward_emails_to: Settings.intercept_and_forward_emails_to,
if Rails.application.secrets.intercept_and_forward_emails_to.present?
options = { forward_emails_to: Rails.application.secrets.intercept_and_forward_emails_to,
deliver_emails_to: ['@example.com'] }

interceptor = MailInterceptor::Interceptor.new(options)
Expand Down
17 changes: 17 additions & 0 deletions test/controllers/superadmin/users_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,21 @@ def test_index_when_user_is_not_superadmin
assert_response :forbidden
end

def test_edit_user_modal_success_response
user = users :admin
sign_in user
get :edit, id: users(:nancy)
assert_response :success
end

def test_user_update_success
admin = users :admin
sign_in admin
nancy = users :nancy

post :update, id: nancy, user: {first_name: 'Jane'}
nancy.reload

assert 'Jane', nancy.first_name
end
end
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

def enable_test_coverage
require 'simplecov'

Expand Down

0 comments on commit 5244fbd

Please sign in to comment.