Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-29 22:04:57 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-07-01 00:47:53 +0300
commit42b643f0573abe2536f8235a8198bcddc076e87b (patch)
tree90ba54777f8bf0602e0502caf9f84e397aa57dd1 /spec/support
parent366799bbf143220fe34e53e56cac0fccf8ad4f1f (diff)
Fix ApplicationHelper specs
There were several specs that were failing when run by themselves. - Use the `helper` object, as per RSpec 3 standards - Use `assign` to assign instance variables that helpers expect - Add `StubConfiguration` support module
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/stub_configuration.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/stub_configuration.rb b/spec/support/stub_configuration.rb
new file mode 100644
index 00000000000..ad86abdbb41
--- /dev/null
+++ b/spec/support/stub_configuration.rb
@@ -0,0 +1,14 @@
+module StubConfiguration
+ def stub_application_setting(messages)
+ allow(Gitlab::CurrentSettings.current_application_settings).
+ to receive_messages(messages)
+ end
+
+ def stub_config_setting(messages)
+ allow(Gitlab.config.gitlab).to receive_messages(messages)
+ end
+
+ def stub_gravatar_setting(messages)
+ allow(Gitlab.config.gravatar).to receive_messages(messages)
+ end
+end