diff --git a/app/assets/javascripts/dashboard.js.coffee b/app/assets/javascripts/dashboard.js.coffee index f15d09dd475..6171e0d50fd 100644 --- a/app/assets/javascripts/dashboard.js.coffee +++ b/app/assets/javascripts/dashboard.js.coffee @@ -4,11 +4,11 @@ window.dashboardPage = -> event.preventDefault() toggleFilter $(this) reloadActivities() - + reloadActivities = -> $(".content_list").html '' Pager.init 20, true - + toggleFilter = (sender) -> sender.parent().toggleClass "inactive" event_filters = $.cookie("event_filter") @@ -17,11 +17,11 @@ toggleFilter = (sender) -> event_filters = event_filters.split(",") else event_filters = new Array() - + index = event_filters.indexOf(filter) if index is -1 event_filters.push filter else event_filters.splice index, 1 - + $.cookie "event_filter", event_filters.join(",") diff --git a/app/assets/javascripts/merge_requests.js.coffee b/app/assets/javascripts/merge_requests.js.coffee index 9c9cc6132b3..65ed817c7c6 100644 --- a/app/assets/javascripts/merge_requests.js.coffee +++ b/app/assets/javascripts/merge_requests.js.coffee @@ -1,6 +1,6 @@ # # * Filter merge requests -# +# @merge_requestsPage = -> $('#assignee_id').chosen() $('#milestone_id').chosen() @@ -8,16 +8,16 @@ $(this).closest('form').submit() class MergeRequest - + constructor: (@opts) -> this.$el = $('.merge-request') @diffs_loaded = false @commits_loaded = false - + this.activateTab(@opts.action) - + this.bindEvents() - + this.initMergeWidget() this.$('.show-all-commits').on 'click', => this.showAllCommits() @@ -28,7 +28,7 @@ class MergeRequest initMergeWidget: -> this.showState( @opts.current_state ) - + if this.$('.automerge_widget').length and @opts.check_enable $.get @opts.url_to_automerge_check, (data) => this.showState( data.state ) @@ -42,12 +42,12 @@ class MergeRequest bindEvents: -> this.$('.nav-tabs').on 'click', 'a', (event) => a = $(event.currentTarget) - + href = a.attr('href') History.replaceState {path: href}, document.title, href - + event.preventDefault() - + this.$('.nav-tabs').on 'click', 'li', (event) => this.activateTab($(event.currentTarget).data('action')) diff --git a/spec/factories/user_team_project_relationships.rb b/spec/factories/user_team_project_relationships.rb index fa0f26e7455..93c7b57d0fa 100644 --- a/spec/factories/user_team_project_relationships.rb +++ b/spec/factories/user_team_project_relationships.rb @@ -2,8 +2,8 @@ FactoryGirl.define do factory :user_team_project_relationship do - project_id 1 - user_team_id 1 - greatest_access 1 + project + user_team + greatest_access { UsersProject::MASTER } end end diff --git a/spec/factories/user_team_user_relationships.rb b/spec/factories/user_team_user_relationships.rb index 9b655e00686..55179f9a45b 100644 --- a/spec/factories/user_team_user_relationships.rb +++ b/spec/factories/user_team_user_relationships.rb @@ -2,9 +2,9 @@ FactoryGirl.define do factory :user_team_user_relationship do - user_id 1 - user_team_id 1 + user + user_team group_admin false - permission 1 + permission { UsersProject::MASTER } end end