-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a library that can automatically add view helpers to view specs.
- Loading branch information
Seung-Hyo Choi
committed
Sep 9, 2014
1 parent
829a560
commit ab9dec7
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module BootstrapHamlHelpers | ||
module SpecViewHelpers | ||
def self.included(base) | ||
base.class_eval do | ||
helper BootstrapHamlHelpers::ApplicationHelper if respond_to?(:helper) | ||
|
||
before do | ||
if respond_to?(:view) | ||
BootstrapHamlHelpers::Component::Base.init_context(view) | ||
view.stub(:set_page_title) | ||
view.stub(:add_metatag) | ||
end | ||
end | ||
|
||
after do | ||
BootstrapHamlHelpers::Component::Base.teardown_context if respond_to?(:view) | ||
end | ||
end | ||
end | ||
end | ||
end |