From 6fc53da1a9af811747d3e22e0939dbd6005d2cc1 Mon Sep 17 00:00:00 2001 From: Xavier Shay Date: Fri, 25 Mar 2011 17:26:37 +1100 Subject: [PATCH] Unit test coverage for Comment#requires_openid_authentication? --- spec/models/comment_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index a491394d0..bd0704adc 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -165,3 +165,17 @@ def set_comment_attributes(comment, extra = {}) @comment.author.should == "Your OpenID Name" end end + +describe Comment, '#requires_openid_authentication?' do + describe 'with an author containing a .' do + subject { Comment.new(:author => 'example.com').requires_openid_authentication? } + + it { should be } + end + + describe 'with a normal author' do + subject { Comment.new(:author => 'Don Alias').requires_openid_authentication? } + + it { should_not be } + end +end