#345: updated routes, fixed specs
This commit is contained in:
parent
2cd612e733
commit
e6934057b4
|
@ -3,7 +3,7 @@ class Users::SettingsController < Users::BaseController
|
|||
before_filter :set_current_user
|
||||
|
||||
def profile
|
||||
if request.put?
|
||||
if request.patch?
|
||||
send_confirmation = params[:user][:email] != @user.email
|
||||
if @user.update_without_password(params[:user])
|
||||
update_avatar(@user, params)
|
||||
|
@ -27,7 +27,7 @@ class Users::SettingsController < Users::BaseController
|
|||
end
|
||||
|
||||
def private
|
||||
if request.put?
|
||||
if request.patch?
|
||||
if @user.update_with_password(params[:user])
|
||||
flash[:notice] = t('flash.user.saved')
|
||||
redirect_to private_settings_path
|
||||
|
@ -40,7 +40,7 @@ class Users::SettingsController < Users::BaseController
|
|||
end
|
||||
|
||||
def notifiers
|
||||
if request.put?
|
||||
if request.patch?
|
||||
if @user.notifier.update_attributes(params[:settings_notifier])
|
||||
flash[:notice] = I18n.t("flash.settings.saved")
|
||||
redirect_to notifiers_settings_path
|
||||
|
|
|
@ -3,4 +3,16 @@ class SettingsNotifier < ActiveRecord::Base
|
|||
|
||||
validates :user_id, presence: true
|
||||
|
||||
attr_accessible :can_notify,
|
||||
:update_code,
|
||||
:new_comment_commit_owner,
|
||||
:new_comment_commit_repo_owner,
|
||||
:new_comment_commit_commentor,
|
||||
:new_comment,
|
||||
:new_comment_reply,
|
||||
:new_issue,
|
||||
:issue_assign,
|
||||
:new_build,
|
||||
:new_associated_build
|
||||
|
||||
end
|
||||
|
|
|
@ -243,9 +243,9 @@ Rosa::Application.routes.draw do
|
|||
resources :settings, only: [] do
|
||||
collection do
|
||||
get :profile
|
||||
put :profile
|
||||
patch :profile
|
||||
get :private
|
||||
put :private
|
||||
patch :private
|
||||
get :notifiers
|
||||
patch :notifiers
|
||||
put :reset_auth_token
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ActivityFeed do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
|
||||
it 'is valid given valid attributes' do
|
||||
FactoryGirl.build(:activity_feed).should be_valid
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require 'spec_helper'
|
||||
|
||||
#describe Arch do
|
||||
# pending "add some examples to (or delete) #{__FILE__}"
|
||||
#end
|
||||
describe Arch do
|
||||
|
||||
it 'is valid given valid attributes' do
|
||||
FactoryGirl.build(:arch).should be_valid
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue