spec/page_spec.rb in spidr-0.2.1 vs spec/page_spec.rb in spidr-0.2.2
- old
+ new
@@ -76,6 +76,36 @@
it "should not have a title" do
@page.title.should be_nil
end
end
+
+ describe "cookies" do
+ before(:all) do
+ @page = get_page('http://twitter.com/login')
+ end
+
+ it "should provide access to the raw Cookie" do
+ cookie = @page.cookie
+
+ cookie.should_not be_nil
+ cookie.should_not be_empty
+ end
+
+ it "should provide access to the Cookies" do
+ cookies = @page.cookies
+
+ cookies.should_not be_empty
+ end
+
+ it "should provide access to the key->value pairs within the Cookie" do
+ params = @page.cookie_params
+
+ params.should_not be_empty
+
+ params.each do |key,value|
+ key.should_not be_empty
+ value.should_not be_empty
+ end
+ end
+ end
end