mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Refactoring spec organization
This commit is contained in:
commit
173c705422
13 changed files with 7 additions and 18 deletions
1
.rspec
Normal file
1
.rspec
Normal file
|
@ -0,0 +1 @@
|
|||
--color
|
|
@ -1,5 +1,4 @@
|
|||
require 'spec_helper'
|
||||
require 'draper'
|
||||
|
||||
describe Draper::Base do
|
||||
before(:each){ ApplicationController.new.set_current_view_context }
|
|
@ -1,5 +1,4 @@
|
|||
require 'spec_helper'
|
||||
require 'draper'
|
||||
|
||||
describe Draper::ViewContext do
|
||||
let (:app_controller) do
|
||||
|
@ -22,14 +21,4 @@ describe Draper::ViewContext do
|
|||
Draper::ViewContext.current = nil
|
||||
expect {app_controller.current_view_context}.should raise_exception(Exception)
|
||||
end
|
||||
|
||||
it "sets view_context every time" do
|
||||
app_controller_instance.stub(:view_context) { 'first' }
|
||||
app_controller_instance.set_current_view_context
|
||||
Draper::ViewContext.current.should == 'first'
|
||||
|
||||
app_controller_instance.stub(:view_context) { 'second' }
|
||||
app_controller_instance.set_current_view_context
|
||||
Draper::ViewContext.current.should == 'second'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +1,5 @@
|
|||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
Bundler.require
|
||||
require './spec/samples/application_helper.rb'
|
||||
Dir.glob(['./spec/samples/*.rb', './spec/support/*.rb']) do |file|
|
||||
require file
|
||||
end
|
||||
|
||||
Dir['./spec/support/**/*.rb'].each {|file| require file }
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require './spec/support/samples/application_helper'
|
||||
|
||||
module ActionController
|
||||
class Base
|
||||
@@before_filters = []
|
||||
|
@ -29,4 +31,4 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
Draper::System.setup
|
||||
Draper::System.setup
|
Loading…
Add table
Reference in a new issue