diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-27 12:22:35 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-27 12:22:35 +0300 |
commit | 0be6debb0b3350f35bf4b6a904c60da826314b3b (patch) | |
tree | 5a9281db4a97d8ffa8f3efc73e17fb0b11b17aef /spec/support | |
parent | d371331a65070ce5b3ab9c210eac697062170c91 (diff) | |
parent | cd6046e1dd347f3a9bd7d062447aa25306a5755b (diff) |
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into backup-archive-permissions
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/coverage.rb | 8 | ||||
-rw-r--r-- | spec/support/mentionable_shared_examples.rb | 2 | ||||
-rw-r--r-- | spec/support/stub_configuration.rb | 26 | ||||
-rw-r--r-- | spec/support/test_env.rb | 11 |
4 files changed, 35 insertions, 12 deletions
diff --git a/spec/support/coverage.rb b/spec/support/coverage.rb deleted file mode 100644 index a54bf03380c..00000000000 --- a/spec/support/coverage.rb +++ /dev/null @@ -1,8 +0,0 @@ -if ENV['SIMPLECOV'] - require 'simplecov' -end - -if ENV['COVERALLS'] - require 'coveralls' - Coveralls.wear_merged! -end diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb index a2a0b6905f9..f0717e61781 100644 --- a/spec/support/mentionable_shared_examples.rb +++ b/spec/support/mentionable_shared_examples.rb @@ -143,6 +143,6 @@ shared_examples 'an editable mentionable' do end set_mentionable_text.call(new_text) - subject.notice_added_references(project, author) + subject.create_new_cross_references!(project, author) end end diff --git a/spec/support/stub_configuration.rb b/spec/support/stub_configuration.rb index ad86abdbb41..e4004ec8f79 100644 --- a/spec/support/stub_configuration.rb +++ b/spec/support/stub_configuration.rb @@ -1,5 +1,10 @@ module StubConfiguration def stub_application_setting(messages) + add_predicates(messages) + + # Stubbing both of these because we're not yet consistent with how we access + # current application settings + allow_any_instance_of(ApplicationSetting).to receive_messages(messages) allow(Gitlab::CurrentSettings.current_application_settings). to receive_messages(messages) end @@ -11,4 +16,25 @@ module StubConfiguration def stub_gravatar_setting(messages) allow(Gitlab.config.gravatar).to receive_messages(messages) end + + private + + # Modifies stubbed messages to also stub possible predicate versions + # + # Examples: + # + # add_predicates(foo: true) + # # => {foo: true, foo?: true} + # + # add_predicates(signup_enabled?: false) + # # => {signup_enabled? false} + def add_predicates(messages) + # Only modify keys that aren't already predicates + keys = messages.keys.map(&:to_s).reject { |k| k.end_with?('?') } + + keys.each do |key| + predicate = key + '?' + messages[predicate.to_sym] = messages[key.to_sym] + end + end end diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index 2bdb64ff314..ae0b95ea444 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -5,6 +5,7 @@ module TestEnv # When developing the seed repository, comment out the branch you will modify. BRANCH_SHA = { + 'empty-branch' => '7efb185', 'flatten-dir' => 'e56497b', 'feature' => '0b4bc9a', 'feature_conflict' => 'bb5206f', @@ -14,9 +15,13 @@ module TestEnv 'master' => '5937ac0' } - FORKED_BRANCH_SHA = BRANCH_SHA.merge({ - 'add-submodule-version-bump' => '3f547c08' - }) + # gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily + # need to keep all the branches in sync. + # We currently only need a subset of the branches + FORKED_BRANCH_SHA = { + 'add-submodule-version-bump' => '3f547c08', + 'master' => '5937ac0' + } # Test environment # |