gitlab-org--gitlab-foss/spec
Robert Speicher e8cd04e831 Merge branch 'branch-tag-count-methods' into 'master'
Use dedicated methods for counting branches and tags

This started out as "Lets add two methods to count and cache some data" and ended up in a clean-up/fix of some existing code. The two problems were:

1. Different code was used for adding/removing branches/tags via Git and the UI
2. The code used for the UI didn't have any RSpec tests, and I couldn't find any Spinach tests either (though grepping for Spinach stuff is hard)

This MR addresses the following:

1. `Repository#branch_count` and `Repository#tag_count` are used to count and cache the number of branches/tags, these methods are then used on the branches/commits/tags pages.
2. `Repository#add_tag`, `Repository#add_branch`, `Repository#rm_tag` and `Repository#rm_branch` now all the appropriate before/after hook methods instead of calling a random single cache expiration method. This ensures caches are properly flushed when adding/removing tags/branches via the UI.
3. RSpec tests were added for the above methods.

This fixes gitlab-org/gitlab-ce#13459

See merge request !3128
2016-03-08 20:11:40 +00:00
..
benchmarks Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
config Don't load all of GitLab in mail_room 2016-02-26 18:48:13 -08:00
controllers Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
factories Merge branch 'rs-factory-nitpicks' into 'master' 2016-03-07 09:02:49 +00:00
features Allow the initial admin to set a password 2016-03-04 17:37:57 -05:00
finders remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
fixtures Add support for keyword arguments in label reference method 2016-03-03 10:41:11 +01:00
helpers Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
initializers Ensure Gravatar host looks like an actual host 2016-01-18 14:58:16 +01:00
javascripts Change `js-quick-submit` behavior to expect the class on the form 2016-03-02 15:11:15 -05:00
lib Merge branch 'feature/cross-project-labels' into 'master' 2016-03-07 09:16:22 +00:00
mailers Move profile notifications specs to separate file 2016-02-12 14:01:28 +01:00
models Call after_create_branch in Repository#add_branch 2016-03-08 18:19:40 +01:00
requests Merge branch 'evuez/gitlab-ce-add-info-user-api' into 'master' 2016-03-08 17:30:10 +00:00
routing Remove `Profile::KeysController#new` action 2016-03-03 16:13:59 -05:00
services Cache & flush tag/branch counts 2016-03-08 18:19:40 +01:00
support Merge branch 'feature/jschatz1/sidebar-sizing' into 'master' 2016-02-24 23:09:29 +00:00
tasks/gitlab Add lfs to backup specs. 2015-11-19 10:43:45 +01:00
views Move "I should see Crowd login form" feature to a view spec 2016-02-24 17:38:13 -05:00
workers Expire caches after forking/importing a repository 2016-02-17 11:38:18 +01:00
factories_spec.rb
rails_helper.rb
spec_helper.rb Add temporary monkey patch to get specs passing on 4.2.5.1 2016-01-25 14:53:28 -08:00
teaspoon_env.rb