diff --git a/lib/semantic_rails_view_helpers/capybara.rb b/lib/semantic_rails_view_helpers/capybara.rb index 028457b..b809bf5 100644 --- a/lib/semantic_rails_view_helpers/capybara.rb +++ b/lib/semantic_rails_view_helpers/capybara.rb @@ -8,6 +8,12 @@ def find_attribute(name, value = nil) attribute end +def has_attribute?(name, value) + attribute = find_attribute(name) + + attribute.text == value +end + def find_input(name) find("[name$='[#{name}]']") end @@ -98,3 +104,4 @@ def within_any(search, &block) false end + diff --git a/lib/semantic_rails_view_helpers/view_helpers.rb b/lib/semantic_rails_view_helpers/view_helpers.rb index cd860d9..fb20a61 100644 --- a/lib/semantic_rails_view_helpers/view_helpers.rb +++ b/lib/semantic_rails_view_helpers/view_helpers.rb @@ -33,6 +33,10 @@ module SemanticRailsViewHelpers action = nil end + if action == :show + action = nil + end + options = Hash[options.collect { |k, v| [ k, CGI.escapeHTML(v.to_s) ] }] route = model