diff options
author | Kirilll Zaitsev <kirik910@gmail.com> | 2015-08-27 02:58:49 +0300 |
---|---|---|
committer | Kirilll Zaitsev <kirik910@gmail.com> | 2015-09-02 05:52:16 +0300 |
commit | 263abda3fd7ddfb826cd17ae88fb47d0e1d67fae (patch) | |
tree | 14a7085fc1998bbb0d30b7d1e5dca71f6b599193 /spec/support/services_shared_context.rb | |
parent | 308c6428aef2a46b0370a24d85a97b0e133283a8 (diff) |
Drone CI service
Diffstat (limited to 'spec/support/services_shared_context.rb')
-rw-r--r-- | spec/support/services_shared_context.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/services_shared_context.rb b/spec/support/services_shared_context.rb new file mode 100644 index 00000000000..4d007ae55ee --- /dev/null +++ b/spec/support/services_shared_context.rb @@ -0,0 +1,21 @@ +Service.available_services_names.each do |service| + shared_context service do + let(:dashed_service) { service.dasherize } + let(:service_method) { "#{service}_service".to_sym } + let(:service_klass) { "#{service}_service".classify.constantize } + let(:service_attrs_list) { service_klass.new.fields.inject([]) {|arr, hash| arr << hash[:name].to_sym } } + let(:service_attrs) do + service_attrs_list.inject({}) do |hash, k| + if k =~ /^(token*|.*_token|.*_key)/ + hash.merge!(k => 'secrettoken') + elsif k =~ /^(.*_url|url|webhook)/ + hash.merge!(k => "http://example.com") + elsif service == 'irker' && k == :recipients + hash.merge!(k => 'irc://irc.network.net:666/#channel') + else + hash.merge!(k => "someword") + end + end + end + end +end |