Skip to content

Commit

Permalink
Added specs for our legend view.
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Apr 20, 2010
1 parent 5b636e3 commit 4adca66
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/views/features/merge.html.erb
Expand Up @@ -6,6 +6,7 @@
<p class="gd">Removing from file</p>
<p class="gi">Adding to file</p>
</div>

<span id="panel" class="ui-widget ui-widget-content ui-corner-all">
<%= link_to 'Dry-run', file_merge_feature_path(@feature, :dry_run => true) %>
<%= link_to 'Patch', file_merge_feature_path(@feature) %>
Expand Down
4 changes: 4 additions & 0 deletions app/views/features/system_merge.html.erb
Expand Up @@ -2,6 +2,10 @@
<%= stylesheet_link_tag "pretty_diff" %>
<% end %>

<div class="legend highlighttable">
<p class="gi">Adding to system</p>
<p class="gd">Removing from system</p>
</div>
<span id="panel" class="ui-widget ui-widget-content ui-corner-all">
<%= link_to 'Update', system_sync_feature_path(@feature) %>
</span>
Expand Down
16 changes: 16 additions & 0 deletions spec/views/features/system_merge.html.erb_spec.rb
Expand Up @@ -15,5 +15,21 @@
it "should have a link to update the system feature" do
response.should have_selector :a, attributes = {:href => system_sync_feature_path(@feature)}
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|
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|
content.should contain "Removing from system"
end
end
end
end
end

0 comments on commit 4adca66

Please sign in to comment.