Skip to content

Commit

Permalink
Add section button helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
mmangino committed Aug 7, 2008
1 parent 84eab7e commit 3e68ff5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/facebooker/rails/helpers.rb
Expand Up @@ -528,6 +528,14 @@ def fb_board(xid,options={})
tag("fb:board",stringify_vals(options.merge(:xid=>xid)))
end

def fb_add_profile_section
tag "fb:add-section-button",:section=>"profile"
end

def fb_add_info_section
tag "fb:add-section-button",:section=>"info"
end

def fb_prompt_permission(permission,message,callback=nil)
raise(ArgumentError, "Unknown value for permission: #{permission}") unless VALID_PERMISSIONS.include?(permission.to_sym)
args={:perms=>permission}
Expand Down
8 changes: 8 additions & 0 deletions test/rails_integration_test.rb
Expand Up @@ -560,6 +560,14 @@ def test_fb_prompt_permission_invalid_option
assert_raises(ArgumentError) {@h.fb_prompt_permission("invliad", "a message")}

end

def test_fb_add_profile_section
assert_equal "<fb:add-section-button section=\"profile\" />",@h.fb_add_profile_section
end

def test_fb_add_info_section
assert_equal "<fb:add-section-button section=\"info\" />",@h.fb_add_info_section
end

def test_fb_name_with_invalid_key
assert_raises(ArgumentError) {@h.fb_name(1234, :sizee => false)}
Expand Down

0 comments on commit 3e68ff5

Please sign in to comment.