-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The hamlit-rails is not maintained at all and we don't need the provided generators at all.
- Loading branch information
Showing
5 changed files
with
32 additions
and
7 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require 'hamlit-rails' | ||
require 'hamlit' | ||
class GenericMailer < ActionMailer::Base | ||
include Vmdb::Logging | ||
|
||
|
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'hamlit-rails' | ||
|
||
module Spec | ||
module Support | ||
module ViewHelper | ||
|
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,30 @@ | ||
module ViewSpecHelper | ||
def show_element(resp, id) | ||
set_element_visibility(resp, id, true) | ||
end | ||
|
||
def hide_element(resp, id) | ||
set_element_visibility(resp, id, false) | ||
end | ||
|
||
private | ||
|
||
def set_element_visibility(resp, id, visible) | ||
c = Capybara.string(resp) | ||
node = c.find(id, :visible => :all) | ||
node.native["style"] = node.native["style"].gsub(/display\s*:[^;]+/, "display:#{visible ? "show" : "none"}") | ||
c.native.to_s | ||
end | ||
|
||
def set_controller_for_view(controller_name) | ||
controller.request.path_parameters[:controller] = controller_name | ||
end | ||
|
||
def set_controller_for_view_to_be_restful | ||
allow(controller).to receive(:restful?).and_return(true) | ||
end | ||
|
||
def set_controller_for_view_to_be_nonrestful | ||
allow(controller).to receive(:restful?).and_return(false) | ||
end | ||
end |