Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Fixed spec_helper and renamed controller and helper
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmcelwee committed Mar 26, 2012
1 parent df7d954 commit d1c2418
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'fastercsv'

class Admin::ShippingdocsController < Admin::BaseController
include Admin::ShippingdocsHelper
class Admin::ShippingDocsController < Admin::BaseController
include Admin::ShippingDocsHelper

def index

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Admin::ShippingdocsHelper
module Admin::ShippingDocsHelper

def csv_header_row
[
Expand Down
10 changes: 10 additions & 0 deletions spec/controllers/admin/shipping_docs_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::ShippingDocsController do

#Delete this example and add some real ones
it "should use Admin::ShippingDocsController" do
controller.should be_an_instance_of(Admin::ShippingDocsController)
end

end
10 changes: 0 additions & 10 deletions spec/controllers/admin/shippingdocs_controller_spec.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require File.dirname(__FILE__) + '/../../spec_helper'

describe Admin::ShippingdocsHelper do
describe Admin::ShippingDocsHelper do

#Delete this example and add some real ones or delete this file
it "should include the Admin::ShippingdocsHelper" do
it "should include the Admin::ShippingDocsHelper" do
included_modules = self.metaclass.send :included_modules
included_modules.should include(Admin::ShippingdocsHelper)
included_modules.should include(Admin::ShippingDocsHelper)
end

end
61 changes: 28 additions & 33 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
unless defined? SPREE_ROOT
ENV["RAILS_ENV"] = "test"
case
when ENV["SPREE_ENV_FILE"]
require ENV["SPREE_ENV_FILE"]
when File.dirname(__FILE__) =~ %r{vendor/SPREE/vendor/extensions}
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
else
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
end
end
require "#{SPREE_ROOT}/spec/spec_helper"
ENV["RAILS_ENV"] = 'test'
require File.expand_path("../../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'

if File.directory?(File.dirname(__FILE__) + "/scenarios")
Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios"
end
if File.directory?(File.dirname(__FILE__) + "/matchers")
Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec

# config.fixture_path = "#{::Rails.root}/spec/fixtures"

config.include Devise::TestHelpers, :type => :controller
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, comment the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
end

Spec::Runner.configure do |config|
# config.use_transactional_fixtures = true
# config.use_instantiated_fixtures = false
# config.fixture_path = RAILS_ROOT + '/spec/fixtures'
class ActionDispatch::IntegrationTest
include Capybara::DSL

# You can declare fixtures for each behaviour like this:
# describe "...." do
# fixtures :table_a, :table_b
#
# Alternatively, if you prefer to declare them only once, you can
# do so here, like so ...
#
# config.global_fixtures = :table_a, :table_b
#
# If you declare global fixtures, be aware that they will be declared
# for all of your examples, even those that don't use them.
end
def teardown
Capybara.reset_sessions!
Capybara.use_default_driver
end
end

0 comments on commit d1c2418

Please sign in to comment.