Permalink
Browse files

Organizations can now pitch

  • Loading branch information...
1 parent 93965d1 commit 366f2ccdc8ab1344d86b131350d606832cfbf066 @spherop spherop committed Sep 18, 2009
@@ -9,7 +9,7 @@ def start_story
if !logged_in?
session[:return_to] = start_story_path
redirect_to new_session_path
- elsif logged_in? && current_user.is_a?(Reporter)
+ elsif logged_in? && current_user.is_a?(Reporter) || current_user.is_a?(Organization)
redirect_to new_pitch_path
else
redirect_to new_tip_path
View
@@ -170,7 +170,7 @@ def self.with_sort(sort='desc')
end
def self.createable_by?(user)
- user && user.reporter?
+ user && user.reporter? || user.organization?
end
def featured?
@@ -22,6 +22,7 @@
config.gem "rubyist-aasm", :lib => "aasm", :version => '>=2.0.5', :source => 'http://gems.github.com'
config.gem 'mislav-will_paginate', :lib => 'will_paginate', :version => '>=2.3.7', :source => 'http://gems.github.com/'
config.gem "rspec-rails", :lib => false, :version => "= 1.2.2"
+ config.gem "rspec", :lib => false, :version => "= 1.2.2"
config.gem "cucumber", :lib => false, :version => "= 0.1.16"
config.gem "webrat", :lib => false, :version => ">= 0.4.4"
config.gem "money", :version => ">=2.1.3"
@@ -1,5 +1,6 @@
class LoadDisplayNameForDefaultNetwork < ActiveRecord::Migration
def self.up
+ #Network.reset_column_information
Network.create!(:name => 'sfbay', :display_name => 'Bay Area')
end
@@ -508,6 +508,10 @@
it "is creatable by reporter" do
Pitch.createable_by?(Factory(:reporter)).should be
end
+
+ it "is creatable by organization" do
+ Pitch.createable_by?(Factory(:organization)).should be
+ end
it "is not creatable by user" do
Pitch.createable_by?(Factory(:user)).should_not be_true

0 comments on commit 366f2cc

Please sign in to comment.