Skip to content

Commit

Permalink
Remove OpenID authority field from comments
Browse files Browse the repository at this point in the history
This is not supported by the openid plugin, and is kinda useless info anyway
  • Loading branch information
xaviershay committed Dec 24, 2008
1 parent 8a12ae5 commit f06cb00
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
1 change: 0 additions & 1 deletion app/controllers/comments_controller.rb
Expand Up @@ -49,7 +49,6 @@ def create
@comment.author_url = @comment.author
@comment.author = (registration["fullname"] || registration["nickname"] || @comment.author_url).to_s
@comment.author_email = registration["email"].to_s
@comment.author_openid_authority = result.server_url

@comment.openid_error = ""
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/url_helper.rb
Expand Up @@ -38,7 +38,7 @@ def author_link(comment)
if comment.author_url.blank?
h(comment.author)
else
link_to(h(comment.author), h(comment.author_url), :title => h("Authenticated by #{comment.author_openid_authority}"), :class => 'openid')
link_to(h(comment.author), h(comment.author_url), :class => 'openid')
end
end

Expand Down
1 change: 0 additions & 1 deletion app/models/comment.rb
Expand Up @@ -23,7 +23,6 @@ def apply_filter
end

def blank_openid_fields
self.author_openid_authority = ""
self.author_url = ""
self.author_email = ""
end
Expand Down
@@ -0,0 +1,9 @@
class RemoveOpenidAuthorityFromComment < ActiveRecord::Migration
def self.up
remove_column :comments, :author_openid_authority
end

def self.down
add_column :comments, :author_openid_authority, :string, :null => false
end
end
1 change: 0 additions & 1 deletion db/schema.rb
Expand Up @@ -16,7 +16,6 @@
t.string "author", :null => false
t.string "author_url", :null => false
t.string "author_email", :null => false
t.string "author_openid_authority", :null => false
t.text "body", :null => false
t.text "body_html", :null => false
t.datetime "created_at"
Expand Down
9 changes: 0 additions & 9 deletions spec/controllers/comments_controller_spec.rb
Expand Up @@ -184,10 +184,6 @@ def do_post

it_should_behave_like("creating new comment")

it 'records OpenID authority ' do
assigns(:comment).author_openid_authority.should == 'http://example.com'
end

it 'records OpenID identity url' do
assigns(:comment).author_url.should == 'http://enkiblog.com'
end
Expand All @@ -212,7 +208,6 @@ def do_post
# Attributes you are not allowed to set
:author_url => 'http://www.enkiblog.com',
:author_email => 'donalias@enkiblog.com',
:author_openid_authority => 'http://enkiblog.com/openid_server',
:created_at => @created_at = 1.year.ago,
:updated_at => @updated_at = 1.year.ago,
}
Expand All @@ -235,10 +230,6 @@ def do_post
assigns(:comment).author_email.should be_blank
end

it "forbids setting of author_openid_authority" do
assigns(:comment).author_openid_authority.should be_blank
end

it "forbids setting of created_at" do
assigns(:comment).created_at.should_not == @created_at
end
Expand Down
1 change: 0 additions & 1 deletion spec/models/comment_spec.rb
Expand Up @@ -93,7 +93,6 @@ def set_comment_attributes(comment, extra = {})
@comment.blank_openid_fields
end

it('blanks out author_openid_authority') { @comment.author_openid_authority.should == '' }
it('blanks out author_url') { @comment.author_url.should == '' }
it('blanks out author_email') { @comment.author_email.should == '' }
end
Expand Down
1 change: 0 additions & 1 deletion spec/views/admin/comments/show.html.erb_spec.rb
Expand Up @@ -9,7 +9,6 @@
assigns[:comment] = Comment.new(
:author => 'Don Alias',
:author_url => 'http://enkiblog.com',
:author_openid_authority => 'http://example.com',
:author_email => 'donalias@enkiblog.com',
:body => 'Hello I am a post',
:created_at => Time.now
Expand Down

0 comments on commit f06cb00

Please sign in to comment.