Skip to content

Commit

Permalink
Add coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Jul 26, 2017
1 parent c3463bd commit f0d6b49
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 37 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ group :development, :test do
gem "bixby"
gem "bullet"
gem "bundler-audit", ">= 0.5.0", require: false
gem 'coveralls'
gem "dotenv-rails"
gem "factory_girl_rails"
gem "pry-byebug"
Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ GEM
cliver (0.3.2)
coderay (1.1.1)
concurrent-ruby (1.0.5)
coveralls (0.8.21)
json (>= 1.8, < 3)
simplecov (~> 0.14.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
database_cleaner (1.6.1)
Expand Down Expand Up @@ -493,10 +499,13 @@ GEM
string_rtl (0.1.0)
sxp (1.0.0)
rdf (~> 2.0)
term-ansicolor (1.6.0)
tins (~> 1.0)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.8)
timecop (0.9.1)
tins (1.15.0)
title (0.0.7)
i18n
rails (>= 3.1)
Expand Down Expand Up @@ -539,6 +548,7 @@ DEPENDENCIES
blacklight
bullet
bundler-audit (>= 0.5.0)
coveralls
database_cleaner
devise
devise-guests!
Expand Down
5 changes: 0 additions & 5 deletions app/channels/application_cable/channel.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/channels/application_cable/connection.rb

This file was deleted.

6 changes: 0 additions & 6 deletions app/helpers/flashes_helper.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/jobs/application_job.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/mailers/application_mailer.rb

This file was deleted.

5 changes: 0 additions & 5 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
1 change: 1 addition & 0 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
RSpec.describe CatalogController do
let(:persister) { Valkyrie::MetadataAdapter.find(:indexing_persister).persister }
describe "#index" do
render_views
it "finds all public documents" do
persister.save(resource: FactoryGirl.build(:scanned_resource))

Expand Down
13 changes: 12 additions & 1 deletion spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@
require 'rails_helper'

RSpec.describe User, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
subject(:user) { FactoryGirl.create(:user) }
describe "#to_s" do
it "returns the user's email" do
expect(user.to_s).to eq user.email
end
end
describe "#admin?" do
subject(:user) { FactoryGirl.create(:admin) }
it "returns true" do
expect(user).to be_admin
end
end
end
13 changes: 13 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# frozen_string_literal: true
ENV["RACK_ENV"] = "test"
require 'simplecov'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
)
SimpleCov.start "rails" do
add_filter '/valhalla/'
end

require File.expand_path("../../config/environment", __FILE__)
abort("DATABASE_URL environment variable is set") if ENV["DATABASE_URL"]
Expand All @@ -18,6 +30,7 @@ module Features
config.infer_base_class_for_anonymous_controllers = false
config.infer_spec_type_from_file_location!
config.use_transactional_fixtures = false
config.fixture_path = "#{::Rails.root}/spec/fixtures"
end

ActiveRecord::Migration.maintain_test_schema!
7 changes: 0 additions & 7 deletions valhalla/app/mailers/valhalla/application_mailer.rb

This file was deleted.

0 comments on commit f0d6b49

Please sign in to comment.