Make specs run, but they are far from green

pull/6827/head
Michael Frister 12 years ago
parent d92e7b69bd
commit 3aedc76f77
  1. 3
      spec/models/cost_query/chaining_spec.rb
  2. 3
      spec/models/cost_query/filter_spec.rb
  3. 3
      spec/models/cost_query/group_by_spec.rb
  4. 3
      spec/models/cost_query/integration_spec.rb
  5. 3
      spec/models/cost_query/operator_spec.rb
  6. 16
      spec/models/cost_query/query_helper.rb
  7. 3
      spec/models/cost_query/result_spec.rb
  8. 3
      spec/models/cost_query/walker_spec.rb
  9. 27
      spec/spec_helper.rb

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
minimal_query
fixtures :users

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
minimal_query
fixtures :users

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper do
minimal_query
fixtures :users

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
minimal_query
fixtures :users

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
minimal_query
fixtures :users

@ -1,8 +1,14 @@
class Spec::Rails::Example::ModelExampleGroup
def minimal_query
before do
@query = CostQuery.new
@query.send(:minimal_chain!)
module Reporting
module QueryHelper
def minimal_query
before do
@query = CostQuery.new
@query.send(:minimal_chain!)
end
end
end
end
Rspec.configure do |c|
c.extend Reporting::QueryHelper, :reporting_query_helper => true
end

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
before { User.current = users(:admin) }
minimal_query

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require_relative 'query_helper'
describe CostQuery do
describe CostQuery, :reporting_query_helper => true do
minimal_query
fixtures :users

@ -1,4 +1,4 @@
RAILS_ENV = "test"
require 'spec_helper'
# prevent case where we are using rubygems and test-unit 2.x is installed
begin
@ -7,31 +7,16 @@ begin
rescue LoadError
end
begin
require 'spec/spec_helper'
rescue LoadError => error
puts <<-EOS
You need to install rspec in your Redmine project.
Please execute the following code:
gem install rspec-rails
script/generate rspec
EOS
raise error
end
def l(*args)
I18n.t(*args)
end
Fixtures.create_fixtures File.join(File.dirname(__FILE__), "fixtures"), ActiveRecord::Base.connection.tables
require File.join(RAILS_ROOT, "test", "object_daddy_helpers.rb")
Dir.glob(File.expand_path("#{__FILE__}/../../../redmine_costs/test/exemplars/*.rb")) { |e| require e }
Dir.glob(File.expand_path("#{__FILE__}/../models/helpers/*_helper.rb")) { |e| require e }
require 'redmine_factory_girl'
# not sure whether these are required - commenting them out for now
# - mfrister
# require File.join(RAILS_ROOT, "test", "object_daddy_helpers.rb")
# Dir.glob(File.expand_path("#{__FILE__}/../../../redmine_costs/test/exemplars/*.rb")) { |e| require e }
# Dir.glob(File.expand_path("#{__FILE__}/../models/helpers/*_helper.rb")) { |e| require e }
def login_user(user)
@controller.send(:logged_user=, user)

Loading…
Cancel
Save