Skip to content
Snippets Groups Projects
Commit 606a6bb4 authored by maxwell's avatar maxwell
Browse files

status message length is limited to 1000 chars.

parent 69133817
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,8 @@
# the COPYRIGHT file.
class StatusMessage < Post
validates_length_of :message, :maximum => 1000, :message => "please make your status messages less than 1000 characters"
xml_name :status_message
xml_accessor :message
......
......@@ -21,6 +21,15 @@ describe StatusMessage do
status = @user.post(:status_message, :message => "Users do things", :to => @aspect.id)
end
it 'should require status messages to be less than 1000 characters' do
message = ''
1001.times do message = message +'1';end
status = Factory.build(:status_message, :message => message)
status.should_not be_valid
end
describe "XML" do
it 'should serialize to XML' do
message = Factory.create(:status_message, :message => "I hate WALRUSES!", :person => @user.person)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment