Sha256: 52de8a54a7fd412429e6b422c0378dd50090111f4abb2dc3ab111097f09f3d0a
Contents?: true
Size: 1.87 KB
Versions: 7
Compression:
Stored size: 1.87 KB
Contents
require File.dirname(__FILE__) + '/../test_helper' class Muck::ActivitiesControllerTest < ActionController::TestCase tests Muck::ActivitiesController context "activities controller" do setup do activate_authlogic @user = Factory(:user) login_as @user end context 'on GET to index (js)' do setup do @activity = Factory(:activity) get :index, :parent_type => @user.type, :parent_id => @user, :format => 'js', :latest_activity_id => @activity.to_param end should_respond_with :success end context 'on GET to index (js) no latest activity id' do setup do get :index, :parent_type => @user.type, :parent_id => @user, :format => 'js', :latest_activity_id => nil end should_respond_with :success end context 'on POST to create (js)' do setup do post :create, :activity => { :content => 'test activity' }, :parent_type => @user.type, :parent_id => @user, :format => 'js' end should_respond_with :success should_not_set_the_flash end context 'on POST to create' do setup do post :create, :activity => { :content => 'test activity' }, :parent_type => @user.type, :parent_id => @user end should_redirect_to('show user page (user dashboard)') { @user } end context 'on DELETE to destroy' do setup do @activity = Factory(:activity, :source => @user) delete :destroy, :id => @activity.id end should_respond_with :redirect should_set_the_flash_to(I18n.t("muck.activities.item_removed")) end context 'on DELETE to destroy (js)' do setup do @activity = Factory(:activity, :source => @user) delete :destroy, :id => @activity.id, :format => 'js' end should_respond_with :success should_not_set_the_flash end end end
Version data entries
7 entries across 7 versions & 2 rubygems