Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use named subject

  • Loading branch information...
commit bc1bae91b10d8dea17799bb45e6e3b67a17ee1e4 1 parent 3db25ff
@nashby nashby authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 spec/draper/view_helpers_spec.rb
View
14 spec/draper/view_helpers_spec.rb
@@ -1,12 +1,13 @@
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
@@ -14,7 +15,7 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.