spec/ruhl_spec.rb in ruhl-0.16.0 vs spec/ruhl_spec.rb in ruhl-0.17.0

- old
+ new

@@ -93,11 +93,11 @@ end it_should_behave_like "having sidebar" it "should update the h1" do - puts @doc.xpath("//div[@id='main']").first.children[1]. + @doc.xpath("//div[@id='main']").first.children[1]. inner_html.should == "Welcome to the Home page" end end shared_examples_for "if with no users" do @@ -152,9 +152,30 @@ @doc = create_doc end it_should_behave_like "if with users" end + + describe "hash returned" do + before do + class ContextObject + def users? + true + end + end + + @html = File.read html(:if_with_hash) + @doc = create_doc + end + + it "should use hash appropriately" do + ptag = @doc.xpath("/html/body/p").first + ptag["class"].should == "pretty" + ptag["id"].should == "8675309" + ptag.inner_html.should=="jenny" + end + end + end describe "if_on_collection.html" do describe "user_list is empty" do before do