spec/ruhl_spec.rb in ruhl-0.10.1 vs spec/ruhl_spec.rb in ruhl-0.11.0
- old
+ new
@@ -65,22 +65,34 @@
doc.xpath('//h1').should_not be_empty
doc.xpath('//p').should_not be_empty
end
end
- describe "main_with_sidebar.html" do
- before do
- @html = File.read html(:main_with_sidebar)
- end
-
+ shared_examples_for "having sidebar" do
it "should replace sidebar with partial contents" do
doc = create_doc
doc.xpath('/html/body/div/div/div//h3')[0].inner_html.
should == "Real Sidebarlinks"
doc.xpath('/html/body/div/div/div/ul/li//a')[0].inner_html.
should == "Real Link 1"
end
+ end
+
+ describe "main_with_sidebar.html" do
+ before do
+ @html = File.read html(:main_with_sidebar)
+ end
+
+ it_should_behave_like "having sidebar"
+ end
+
+ describe "parameters.html" do
+ before do
+ @html = File.read html(:parameters)
+ end
+
+ it_should_behave_like "having sidebar"
end
shared_examples_for "if with no users" do
it "table should not render" do
nodes = @doc.xpath('/html/body//*')