|
|
@ -29,12 +29,13 @@ |
|
|
|
require 'spec_helper' |
|
|
|
require 'spec_helper' |
|
|
|
|
|
|
|
|
|
|
|
describe MyController, :type => :controller do |
|
|
|
describe MyController, :type => :controller do |
|
|
|
describe 'password change' do |
|
|
|
|
|
|
|
let(:user) { FactoryGirl.create(:user) } |
|
|
|
let(:user) { FactoryGirl.create(:user) } |
|
|
|
before(:each) do |
|
|
|
before(:each) do |
|
|
|
User.stub(:current).and_return(user) |
|
|
|
User.stub(:current).and_return(user) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe 'password change' do |
|
|
|
|
|
|
|
|
|
|
|
describe :password do |
|
|
|
describe :password do |
|
|
|
before do |
|
|
|
before do |
|
|
|
get :password |
|
|
|
get :password |
|
|
@ -96,4 +97,33 @@ describe MyController, :type => :controller do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe "account" do |
|
|
|
|
|
|
|
let(:custom_field) { FactoryGirl.create :text_user_custom_field } |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
custom_field |
|
|
|
|
|
|
|
as_logged_in_user user do |
|
|
|
|
|
|
|
get :account |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "responds with success" do |
|
|
|
|
|
|
|
expect(response).to be_success |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "renders the account template" do |
|
|
|
|
|
|
|
expect(response).to render_template 'account' |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "assigns @user" do |
|
|
|
|
|
|
|
expect(assigns(:user)).to eq(user) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "with render_views" do |
|
|
|
|
|
|
|
render_views |
|
|
|
|
|
|
|
it "renders editable custom fields" do |
|
|
|
|
|
|
|
expect(response.body).to have_content(custom_field.name) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|