Permalink
Browse files

use named subject

  • Loading branch information...
1 parent 3db25ff commit bc1bae91b10d8dea17799bb45e6e3b67a17ee1e4 @nashby nashby committed Nov 3, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 spec/draper/view_helpers_spec.rb
@@ -1,20 +1,21 @@
require 'spec_helper'
describe Draper::ViewHelpers do
+ subject(:view_helpers_class) { Class.new { include Draper::ViewHelpers } }
+
+ let(:view_helpers) { view_helpers_class.new }
let(:helper_proxy) { Draper::HelperProxy.new }
let(:view_context) { Object.new }
- before { view_helpers.helpers.stub(:view_context).and_return(view_context) }
- subject { Class.new { include Draper::ViewHelpers } }
- let(:view_helpers) { subject.new }
+ before { view_helpers.helpers.stub(:view_context).and_return(view_context) }
describe "#helpers" do
it "returns a HelperProxy" do
view_helpers.helpers.should be_a Draper::HelperProxy
end
it "is aliased to #h" do
- view_helpers.h.should be subject.helpers
+ view_helpers.h.should be view_helpers_class.helpers
end
end
@@ -30,12 +31,11 @@
describe ".helpers" do
it "returns a HelperProxy" do
- subject.helpers.should be_a Draper::HelperProxy
+ view_helpers_class.helpers.should be_a Draper::HelperProxy
end
it "is aliased to #h" do
- subject.h.should be subject.helpers
+ view_helpers_class.h.should be view_helpers_class.helpers
end
end
-
end

0 comments on commit bc1bae9

Please sign in to comment.