-
Notifications
You must be signed in to change notification settings - Fork 1
/
system_merge.html.erb_spec.rb
35 lines (30 loc) · 1.36 KB
/
system_merge.html.erb_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require File.dirname(__FILE__) + '/../../spec_helper'
describe "features/system_merge.html.erb" do
describe "GET, system_merge" do
before(:each) do
@feature = FeatureFile.new("#{RAILS_ROOT}/features/plain/tag_cloud.feature").export
File.open("#{RAILS_ROOT}/tmp/tag_cloud.feature", 'w') { |f| f.write(@feature.export) }
@feature.update_attribute(:path, "#{RAILS_ROOT}/spec/fixtures/features/tag_cloud.feature")
assigns[:feature] = @feature
assigns[:pretty] = @feature.diff_reverse
render
end
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 = {: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 = {:id => "legend"} do |legend_wrapper|
legend_wrapper.should have_selector :span, attribute = {:class => "gd"} do |content|
content.should contain "Removing from system"
end
end
end
end
end