diff --git a/app/controllers/users/settings_controller.rb b/app/controllers/users/settings_controller.rb index 1524e9780..4da9b2ce1 100644 --- a/app/controllers/users/settings_controller.rb +++ b/app/controllers/users/settings_controller.rb @@ -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 diff --git a/app/models/settings_notifier.rb b/app/models/settings_notifier.rb index 1ee35f3ca..a531abe68 100644 --- a/app/models/settings_notifier.rb +++ b/app/models/settings_notifier.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 5a8451d56..222fefff0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/spec/factories/activity_feeds.rb b/spec/factories/activity_feeds.rb index 18b296fed..eb92cf21f 100644 --- a/spec/factories/activity_feeds.rb +++ b/spec/factories/activity_feeds.rb @@ -2,5 +2,5 @@ FactoryGirl.define do factory :activity_feed do - end + end end diff --git a/spec/models/activity_feed_spec.rb b/spec/models/activity_feed_spec.rb index c77e1d83a..aa43930b2 100644 --- a/spec/models/activity_feed_spec.rb +++ b/spec/models/activity_feed_spec.rb @@ -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 diff --git a/spec/models/arch_spec.rb b/spec/models/arch_spec.rb index 9cafdfa93..dd3958f45 100644 --- a/spec/models/arch_spec.rb +++ b/spec/models/arch_spec.rb @@ -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