summaryrefslogtreecommitdiff
path: root/spec/support/stub_configuration.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-29 15:04:57 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-30 17:47:53 -0400
commit42b643f0573abe2536f8235a8198bcddc076e87b (patch)
tree90ba54777f8bf0602e0502caf9f84e397aa57dd1 /spec/support/stub_configuration.rb
parent366799bbf143220fe34e53e56cac0fccf8ad4f1f (diff)
downloadgitlab-ce-42b643f0573abe2536f8235a8198bcddc076e87b.tar.gz
Fix ApplicationHelper specsrs-fix-application-helper-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/stub_configuration.rb')
-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