diaspora/spec/controllers/posts_controller_spec.rb
Arzumy MD 3767cce149 moved render_views out of controller specs to spec_helper.
cleaned up indentation and spacing in controller specs.
2011-05-07 18:38:40 +08:00

26 lines
674 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe PostsController do
before do
@user = alice
end
describe '#show' do
it 'shows a public post' do
status = @user.post(:status_message, :text => "hello", :public => true, :to => 'all')
get :show, :id => status.id
response.status= 200
end
it 'does not show a private post' do
status = @user.post(:status_message, :text => "hello", :public => false, :to => 'all')
get :show, :id => status.id
response.status = 302
end
end
end