testing simplecov and rcov stuff
This commit is contained in:
parent
d64fe002dc
commit
e460899ea3
4 changed files with 16 additions and 5 deletions
10
.simplecov
10
.simplecov
|
@ -1,3 +1,7 @@
|
||||||
require 'simplecov-rcov'
|
if ENV['COVERAGE_FORMATTER'] == 'rcov'
|
||||||
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
require 'simplecov-rcov'
|
||||||
SimpleCov.start 'rails'
|
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
||||||
|
end
|
||||||
|
if ENV['COVERAGE'] == 'on'
|
||||||
|
SimpleCov.start 'rails'
|
||||||
|
end
|
||||||
|
|
|
@ -13,17 +13,23 @@ class Synapse < ActiveRecord::Base
|
||||||
validates :permission, presence: true
|
validates :permission, presence: true
|
||||||
validates :permission, inclusion: { in: Perm::ISSIONS.map(&:to_s) }
|
validates :permission, inclusion: { in: Perm::ISSIONS.map(&:to_s) }
|
||||||
|
|
||||||
|
# :nocov:
|
||||||
def user_name
|
def user_name
|
||||||
self.user.name
|
self.user.name
|
||||||
end
|
end
|
||||||
|
# :nocov:
|
||||||
|
|
||||||
|
# :nocov:
|
||||||
def user_image
|
def user_image
|
||||||
self.user.image.url
|
self.user.image.url
|
||||||
end
|
end
|
||||||
|
# :nocov:
|
||||||
|
|
||||||
|
# :nocov:
|
||||||
def as_json(options={})
|
def as_json(options={})
|
||||||
super(:methods =>[:user_name, :user_image])
|
super(:methods =>[:user_name, :user_image])
|
||||||
end
|
end
|
||||||
|
# :nocov:
|
||||||
|
|
||||||
##### PERMISSIONS ######
|
##### PERMISSIONS ######
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash -l
|
#!/bin/bash -l
|
||||||
|
|
||||||
#prerequisites
|
# jenkins machine prerequisites
|
||||||
#sudo aptitude -q -y install libpq-dev
|
#sudo aptitude -q -y install libpq-dev
|
||||||
|
|
||||||
source "$HOME/.rvm/scripts/rvm"
|
source "$HOME/.rvm/scripts/rvm"
|
||||||
|
@ -21,4 +21,4 @@ sed -i -e "s/DB_USERNAME='.*'/DB_USERNAME='jenkins'/" .env
|
||||||
#test
|
#test
|
||||||
bundle install
|
bundle install
|
||||||
rake db:create db:test:prepare
|
rake db:create db:test:prepare
|
||||||
bundle exec rspec
|
COVERAGE=on COVERAGE_FORMATTER=rcov bundle exec rspec
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
require 'simplecov'
|
||||||
require 'support/controller_helpers'
|
require 'support/controller_helpers'
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
Loading…
Add table
Reference in a new issue