diff --git a/app/models/profile.rb b/app/models/profile.rb index 72a597b7f..6ede9a15c 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -23,8 +23,8 @@ class Profile < ActiveRecord::Base validates_length_of :first_name, :maximum => 32 validates_length_of :last_name, :maximum => 32 - validates_format_of :first_name, :with => /\A[^;]+\z/ - validates_format_of :last_name, :with => /\A[^;]+\z/ + validates_format_of :first_name, :with => /\A[^;]+\z/, :allow_nil => true + validates_format_of :last_name, :with => /\A[^;]+\z/, :allow_nil => true attr_accessible :first_name, :last_name, :image_url, :image_url_medium, :image_url_small, :birthday, :gender, :bio, :searchable, :date diff --git a/features/posts.feature b/features/posts.feature index bcb4c6094..4df8fc220 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -5,6 +5,8 @@ Feature: posting I want to tell the world I am eating a yogurt Scenario: post to all aspects + Given that I am a rock star + And I have no open aspects saved Given I am signed in And I have an aspect called "Family" And I am on the home page @@ -12,33 +14,39 @@ Feature: posting When I fill in "status_message_fake_message" with "I am eating a yogurt" And I press "Share" - And I am on the home page + And I follow "Home" Then I should see "I am eating a yogurt" within ".stream_element" Scenario: delete a post + Given that I am a rock star + And I have no open aspects saved Given I am signed in And I have an aspect called "Family" And I am on the home page And I expand the publisher When I fill in "status_message_fake_message" with "I am eating a yogurt" And I press "Share" - And I am on the home page + And I follow "Home" And I hover over the post And I preemptively confirm the alert And I press the first ".delete" within ".stream_element" - And I am on the home page + And I follow "Home" Then I should not see "I am eating a yogurt" Scenario Outline: post to one aspect - Given I have no open aspects saved + Given that I am a rock star + And I have no open aspects saved Given I am signed in And I have an aspect called "PostTo" And I have an aspect called "DidntPostTo" And I am on the home page When I follow "PostTo" + And I wait for the ajax to finish + And I expand the publisher And I fill in "status_message_fake_message" with "I am eating a yogurt" And I press "Share" + And I follow "Home" And I follow "" Then I should "I am eating a yogurt" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index eb5adb46a..b2973362b 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -4,6 +4,10 @@ Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username, @me.aspects.create(:name => "Besties") end +Given /^that I am a rock star$/ do + Given('a user with username "awesome" and password "totallyawesome"') +end + Given /^a user with email "([^\"]*)"$/ do |email| user = Factory(:user, :email => email, :password => 'password', :password_confirmation => 'password', :getting_started => false)