diff --git a/app/views/projects/branches/destroy.js.haml b/app/views/projects/branches/destroy.js.haml
index ec1661c0aaae9558fa3d193a84dc675fe0233c7f..882a4d0c5e26672dd1f439814e0fce7c5c23dd27 100644
--- a/app/views/projects/branches/destroy.js.haml
+++ b/app/views/projects/branches/destroy.js.haml
@@ -1,3 +1 @@
-:plain
-  $(".js-branch-#{@branch_name}").remove();
-  $('.js-totalbranch-count').html("#{@repository.branches.size}")
+$('.js-totalbranch-count').html("#{@repository.branches.size}")
diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature
index abebef04fcd97ae852fd22e0be0f2a6bfae0ae2a..d657bd4951f026fe5e0bb903e77cc0985a650b42 100644
--- a/features/project/commits/branches.feature
+++ b/features/project/commits/branches.feature
@@ -17,3 +17,9 @@ Feature: Project Browse branches
     And I click new branch link
     When I submit new branch form
     Then I should see new branch created
+
+  @javascript
+  Scenario: I delete a branch
+    Given I visit project branches page
+    And I click branch 'improve/awesome' delete link
+    Then I should not see branch 'improve/awesome'
diff --git a/features/steps/project/browse_branches.rb b/features/steps/project/browse_branches.rb
index 7a0625952de787fc628c2e5671a4a6981f3775fb..c00a95a62fd2261a032cb5077583c777acfd92b4 100644
--- a/features/steps/project/browse_branches.rb
+++ b/features/steps/project/browse_branches.rb
@@ -43,4 +43,15 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
       page.should have_content 'deploy_keys'
     end
   end
+
+  step "I click branch 'improve/awesome' delete link" do
+    within '.js-branch-improve\/awesome' do
+      find('.btn-remove').click
+      sleep 0.05
+    end
+  end
+
+  step "I should not see branch 'improve/awesome'" do
+    page.all(visible: true).should_not have_content 'improve/awesome'
+  end
 end