Sha256: 4e73623ffe7d80f598a26c827a91e140fee005509001b2e753eeb3dacf29a264

Contents?: true

Size: 1.06 KB

Versions: 44

Compression:

Stored size: 1.06 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, "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

44 entries across 44 versions & 1 rubygems

Version Path
saucy-0.2.26 spec/controllers/profiles_controller_spec.rb
saucy-0.2.25 spec/controllers/profiles_controller_spec.rb
saucy-0.2.24 spec/controllers/profiles_controller_spec.rb
saucy-0.2.21 spec/controllers/profiles_controller_spec.rb
saucy-0.2.20 spec/controllers/profiles_controller_spec.rb
saucy-0.2.18 spec/controllers/profiles_controller_spec.rb
saucy-0.2.17 spec/controllers/profiles_controller_spec.rb
saucy-0.2.16 spec/controllers/profiles_controller_spec.rb
saucy-0.2.15 spec/controllers/profiles_controller_spec.rb
saucy-0.2.14 spec/controllers/profiles_controller_spec.rb
saucy-0.2.13 spec/controllers/profiles_controller_spec.rb
saucy-0.2.12 spec/controllers/profiles_controller_spec.rb
saucy-0.2.11 spec/controllers/profiles_controller_spec.rb
saucy-0.2.10 spec/controllers/profiles_controller_spec.rb
saucy-0.2.9 spec/controllers/profiles_controller_spec.rb
saucy-0.2.8.1 spec/controllers/profiles_controller_spec.rb
saucy-0.2.8 spec/controllers/profiles_controller_spec.rb
saucy-0.2.7 spec/controllers/profiles_controller_spec.rb
saucy-0.2.6.1 spec/controllers/profiles_controller_spec.rb
saucy-0.2.6 spec/controllers/profiles_controller_spec.rb