Sha256: e6ded38021fc3be9ceb2fc65eab82500649ac591f8d2f450368cfc1458468dbb

Contents?: true

Size: 1.2 KB

Versions: 88

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe ProfilesController, "routes" do
  it { should route(:get, "/profile/edit").to(:action => :edit) }
  it { should route(:put, "/profile").to(:action => :update) }
end

describe ProfilesController, "signed out" do
  it { should deny_access.on(:get, :edit) }
  it { should deny_access.on(:put, :update) }
end

describe ProfilesController, "edit", :as => :user do
  before { get :edit }
  it { should respond_with(:success) }
  it { should assign_to(:user).with(user) }
end

describe ProfilesController, "valid update", :as => :user do
  let(:attributes) { 'attributes' }

  before do
    user.stubs(:update_attributes => true)
    put :update, :user => attributes
  end

  it { should set_the_flash.to(/has been updated/) }

  it "redirects to the user" do
    should redirect_to(edit_profile_url)
  end

  it "updates the user" do
    user.should have_received(:update_attributes).with(attributes)
  end
end

describe ProfilesController, "invalid update", :as => :user do
  before do
    user.stubs(:update_attributes => false)
    get :update, :user => { :email => "" }
  end

  it { should_not set_the_flash }
  it { should render_template(:edit) }
  it { should assign_to(:user).with(user) }
end

Version data entries

88 entries across 88 versions & 2 rubygems

Version Path
saucy-0.14.3 spec/controllers/profiles_controller_spec.rb
saucy-0.10.10 spec/controllers/profiles_controller_spec.rb
saucy-0.14.2 spec/controllers/profiles_controller_spec.rb
saucy-0.14.1 spec/controllers/profiles_controller_spec.rb
saucy-0.14.0 spec/controllers/profiles_controller_spec.rb
saucy-0.13.3 spec/controllers/profiles_controller_spec.rb
saucy-0.13.2 spec/controllers/profiles_controller_spec.rb
saucy-0.10.9 spec/controllers/profiles_controller_spec.rb
saucy-0.10.8 spec/controllers/profiles_controller_spec.rb
saucy-0.13.1 spec/controllers/profiles_controller_spec.rb
saucy-0.13.0 spec/controllers/profiles_controller_spec.rb
saucy-0.12.5 spec/controllers/profiles_controller_spec.rb
saucy-0.12.4 spec/controllers/profiles_controller_spec.rb
saucy-0.12.3 spec/controllers/profiles_controller_spec.rb
saucy-0.12.2 spec/controllers/profiles_controller_spec.rb
saucy-0.12.1 spec/controllers/profiles_controller_spec.rb
saucy-0.12.0 spec/controllers/profiles_controller_spec.rb
saucy-0.11.5 spec/controllers/profiles_controller_spec.rb
saucy-0.11.3 spec/controllers/profiles_controller_spec.rb
saucy-0.11.2 spec/controllers/profiles_controller_spec.rb