Skip to content

Commit

Permalink
Refactored partial and refactored tests with the chance the markup ma…
Browse files Browse the repository at this point in the history
…y change again.
  • Loading branch information
baphled committed Apr 20, 2010
1 parent 7ee38da commit a8b5d45
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
7 changes: 4 additions & 3 deletions app/views/features/_legend.html.erb
@@ -1,4 +1,5 @@
<div class="legend highlighttable">
<p class="gd">Removing from <%=h diff_for %></p>
<p class="gi">Adding to <%=h diff_for %></p>
<div id="legend" class=" highlighttable">
<p>Legend</p>
<span class="gd">Removing from <%=h diff_for %></span>
<span class="gi">Adding to <%=h diff_for %></span>
</div>
5 changes: 2 additions & 3 deletions features/step_definitions/diff_legend_steps.rb
@@ -1,7 +1,6 @@
Then /^changes on the "([^\"]*)" should be displayed as "([^\"]*)"$/ do |legend, class_name|
legend_class = (class_name == "red")? "gd" : "gi"
response.should have_selector :p, attribute = {:class => legend_class} do |content|
response.should have_selector :span, attribute = {:class => legend_class} do |content|
content.should contain legend
end
end

end
8 changes: 4 additions & 4 deletions spec/views/features/merge.html.erb_spec.rb
Expand Up @@ -25,16 +25,16 @@
end

it "should have a legend displaying system changes as green" do
response.should have_selector :div, attribute = {:class => "legend highlighttable"} do |legend_wrapper|
legend_wrapper.should have_selector :p, attribute = {:class => "gd"} do |content|
response.should have_selector :div, attribute = {:id => "legend"} do |legend_wrapper|
legend_wrapper.should have_selector :span, attribute = {:class => "gd"} do |content|
content.should contain "Removing from file"
end
end
end

it "should have a legend displaying file changes as red" do
response.should have_selector :div, attribute = {:class => "legend highlighttable"} do |legend_wrapper|
legend_wrapper.should have_selector :p, attribute = {:class => "gi"} do |content|
response.should have_selector :div, attribute = {:id => "legend"} do |legend_wrapper|
legend_wrapper.should have_selector :span, attribute = {:class => "gi"} do |content|
content.should contain "Adding to file"
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/views/features/system_merge.html.erb_spec.rb
Expand Up @@ -17,16 +17,16 @@
end

it "should have a legend displaying system changes as green" do
response.should have_selector :div, attribute = {:class => "legend highlighttable"} do |legend_wrapper|
legend_wrapper.should have_selector :p, attribute = {:class => "gi"} do |content|
response.should have_selector :div, attribute = {:id => "legend"} do |legend_wrapper|
legend_wrapper.should have_selector :span, attribute = {:class => "gi"} do |content|
content.should contain "Adding to system"
end
end
end

it "should have a legend displaying file changes as red" do
response.should have_selector :div, attribute = {:class => "legend highlighttable"} do |legend_wrapper|
legend_wrapper.should have_selector :p, attribute = {:class => "gd"} do |content|
response.should have_selector :div, attribute = {:id => "legend"} do |legend_wrapper|
legend_wrapper.should have_selector :span, attribute = {:class => "gd"} do |content|
content.should contain "Removing from system"
end
end
Expand Down

0 comments on commit a8b5d45

Please sign in to comment.