Commit d143680c644930b1277f0951b0b1242f86f82e8c

Authored by Dmitriy Zaporozhets
2 parents a243253b 51c30d90

Merge pull request #923 from NARKOZ/refactoring-2

Minor cleanup
app/controllers/projects_controller.rb
@@ -10,19 +10,6 @@ class ProjectsController < ApplicationController @@ -10,19 +10,6 @@ class ProjectsController < ApplicationController
10 before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] 10 before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]
11 before_filter :require_non_empty_project, :only => [:blob, :tree, :graph] 11 before_filter :require_non_empty_project, :only => [:blob, :tree, :graph]
12 12
13 - def index  
14 - @projects = current_user.projects.includes(:events).order("events.created_at DESC")  
15 - @projects = @projects.page(params[:page]).per(40)  
16 - @events = Event.where(:project_id => current_user.projects.map(&:id)).recent.limit(20)  
17 -  
18 - @last_push = current_user.recent_push  
19 -  
20 - respond_to do |format|  
21 - format.html  
22 - format.atom { render :layout => false }  
23 - end  
24 - end  
25 -  
26 def new 13 def new
27 @project = Project.new 14 @project = Project.new
28 end 15 end
config/application.rb
@@ -44,8 +44,5 @@ module Gitlab @@ -44,8 +44,5 @@ module Gitlab
44 44
45 # Version of your assets, change this if you want to expire all your assets 45 # Version of your assets, change this if you want to expire all your assets
46 config.assets.version = '1.0' 46 config.assets.version = '1.0'
47 -  
48 - # Extend assets path  
49 - config.assets.paths << Rails.root.join('vendor', 'assets', 'images', 'jquery-ui')  
50 end 47 end
51 end 48 end
spec/requests/last_push_widget_spec.rb
@@ -10,23 +10,23 @@ describe &quot;Last Push widget&quot; do @@ -10,23 +10,23 @@ describe &quot;Last Push widget&quot; do
10 visit dashboard_path 10 visit dashboard_path
11 end 11 end
12 12
13 - it "should display last push widget with link to merge request page" do 13 + it "should display last push widget with link to merge request page" do
14 page.should have_content "Your last push was to branch new_design" 14 page.should have_content "Your last push was to branch new_design"
15 page.should have_link "Create Merge Request" 15 page.should have_link "Create Merge Request"
16 end 16 end
17 17
18 - describe "click create MR" do 18 + describe "click create MR" do
19 before { click_link "Create Merge Request" } 19 before { click_link "Create Merge Request" }
20 20
21 it { current_path.should == new_project_merge_request_path(@project) } 21 it { current_path.should == new_project_merge_request_path(@project) }
22 it { find("#merge_request_source_branch").value.should == "new_design" } 22 it { find("#merge_request_source_branch").value.should == "new_design" }
23 it { find("#merge_request_target_branch").value.should == "master" } 23 it { find("#merge_request_target_branch").value.should == "master" }
24 - it { find("#merge_request_title").value.should == "\nNew Design" } 24 + it { find("#merge_request_title").value.should == "New Design" }
25 end 25 end
26 26
27 27
28 def create_push_event 28 def create_push_event
29 - data = { 29 + data = {
30 :before => "0000000000000000000000000000000000000000", 30 :before => "0000000000000000000000000000000000000000",
31 :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", 31 :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
32 :ref => "refs/heads/new_design", 32 :ref => "refs/heads/new_design",