article_spec: add deleted test
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
27b84df003
commit
fd17f339d4
4 changed files with 24 additions and 0 deletions
|
@ -47,4 +47,10 @@ Rails.application.configure do
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations
|
||||||
# config.action_view.raise_on_missing_translations = true
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
|
# Enable stdout logger
|
||||||
|
config.logger = Logger.new(STDOUT)
|
||||||
|
|
||||||
|
# Set log level
|
||||||
|
config.log_level = :DEBUG
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,11 @@ describe Article do
|
||||||
expect(article2).to be_invalid
|
expect(article2).to be_invalid
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'can be deleted' do
|
||||||
|
article.mark_as_deleted()
|
||||||
|
expect(article.deleted?).to be true
|
||||||
|
end
|
||||||
|
|
||||||
it 'computes the gross price correctly' do
|
it 'computes the gross price correctly' do
|
||||||
article.deposit = 0
|
article.deposit = 0
|
||||||
article.tax = 12
|
article.tax = 12
|
||||||
|
|
|
@ -4,6 +4,10 @@ describe OrderArticle do
|
||||||
let(:order) { create :order, article_count: 1 }
|
let(:order) { create :order, article_count: 1 }
|
||||||
let(:oa) { order.order_articles.first }
|
let(:oa) { order.order_articles.first }
|
||||||
|
|
||||||
|
it 'foo' do
|
||||||
|
oa.update_article_and_price!()
|
||||||
|
end
|
||||||
|
|
||||||
it 'is not ordered by default' do
|
it 'is not ordered by default' do
|
||||||
expect(OrderArticle.ordered.count).to eq 0
|
expect(OrderArticle.ordered.count).to eq 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,6 +68,15 @@ if ENV['COVERAGE'] == 'lcov'
|
||||||
SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter
|
SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ENV['COVERAGE'] == 'html'
|
||||||
|
require 'simplecov-lcov'
|
||||||
|
SimpleCov::Formatter::LcovFormatter.config do |c|
|
||||||
|
c.report_with_single_file = true
|
||||||
|
c.single_report_path = 'coverage/lcov.html'
|
||||||
|
end
|
||||||
|
SimpleCov.formatters = SimpleCov::Formatter::HTMLFormatter
|
||||||
|
end
|
||||||
|
|
||||||
# include default foodsoft scope in urls, so that *_path works
|
# include default foodsoft scope in urls, so that *_path works
|
||||||
# https://github.com/rspec/rspec-rails/issues/255
|
# https://github.com/rspec/rspec-rails/issues/255
|
||||||
class ActionDispatch::Routing::RouteSet
|
class ActionDispatch::Routing::RouteSet
|
||||||
|
|
Loading…
Reference in a new issue