sermonaudio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.rubocop.yml +15 -0
  4. data/.travis.yml +11 -0
  5. data/Gemfile +24 -0
  6. data/Gemfile.lock +127 -0
  7. data/README.md +258 -0
  8. data/Rakefile +13 -0
  9. data/lib/sermonaudio/actions.rb +99 -0
  10. data/lib/sermonaudio/client.rb +13 -0
  11. data/lib/sermonaudio/configuration.rb +37 -0
  12. data/lib/sermonaudio/version.rb +5 -0
  13. data/lib/sermonaudio.rb +13 -0
  14. data/sermonaudio.gemspec +22 -0
  15. data/spec/actions_spec.rb +236 -0
  16. data/spec/cassettes/SermonAudio_Actions/_favorite_broadcasters/should_return_the_correct_result.yml +508 -0
  17. data/spec/cassettes/SermonAudio_Actions/_favorite_sermons/should_return_the_correct_result.yml +509 -0
  18. data/spec/cassettes/SermonAudio_Actions/_favorite_speakers/should_return_the_correct_result.yml +508 -0
  19. data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_a_larger_set_of_results.yml +521 -0
  20. data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_a_single_result.yml +508 -0
  21. data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_the_correct_results.yml +513 -0
  22. data/spec/cassettes/SermonAudio_Actions/_get_languages/should_return_the_correct_results.yml +506 -0
  23. data/spec/cassettes/SermonAudio_Actions/_get_newest_series_by_member_id/should_return_the_correct_results.yml +508 -0
  24. data/spec/cassettes/SermonAudio_Actions/_get_series_by_member_id/should_return_the_correct_results.yml +508 -0
  25. data/spec/cassettes/SermonAudio_Actions/_get_sermon_info/should_return_the_correct_result.yml +513 -0
  26. data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_keyword/should_return_a_larger_set_of_results.yml +521 -0
  27. data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_keyword/should_return_a_single_result.yml +508 -0
  28. data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_member_id/should_return_the_correct_results.yml +508 -0
  29. data/spec/cassettes/SermonAudio_Actions/_newest_sermons_by_member_id/should_return_the_correct_results.yml +598 -0
  30. data/spec/cassettes/SermonAudio_Actions/_newest_sermons_by_speaker/should_return_the_correct_results.yml +599 -0
  31. data/spec/cassettes/SermonAudio_Actions/_sermon_list/should_return_a_list_of_sermons_for_the_specified_church.yml +1189 -0
  32. data/spec/cassettes/SermonAudio_Sermon/_find_newest_/success/should_find_newest_sermons_by_SpeakerName.yml +599 -0
  33. data/spec/client_spec.rb +15 -0
  34. data/spec/configuration_spec.rb +43 -0
  35. data/spec/fixtures/submit_sermon.xml +8 -0
  36. data/spec/fixtures/update_sermon.xml +6 -0
  37. data/spec/fixtures/wsdl.xml +740 -0
  38. data/spec/spec_helper.rb +46 -0
  39. metadata +134 -0
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe SermonAudio do
4
+
5
+ describe '#client' do
6
+ it "should be a method" do
7
+ expect(SermonAudio).to respond_to :client
8
+ end
9
+
10
+ it "should return a Savon::Client" do
11
+ expect(SermonAudio.client).to be_a Savon::Client
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ module SermonAudio
4
+ describe Configuration do
5
+ subject {
6
+ Class.new do
7
+ include(Configuration)
8
+ end
9
+ }
10
+
11
+ it "should allow for member_id and password to be set" do
12
+ expect(subject).to respond_to :member_id
13
+ expect(subject).to respond_to :password
14
+ end
15
+
16
+ it "should default to environment variables if they are provided" do
17
+ env("SERMONAUDIO_MEMBER_ID" => "example") do
18
+ expect(subject.member_id).to eq "example"
19
+ end
20
+
21
+ env("SERMONAUDIO_PASSWORD" => "example") do
22
+ expect(subject.password).to eq "example"
23
+ end
24
+ end
25
+
26
+ it "should allow member_id and password to be explicitly set" do
27
+ subject.member_id = "other_id"
28
+ subject.password = "other_password"
29
+
30
+ env("SERMONAUDIO_MEMBER_ID" => "example", "SERMONAUDIO_PASSWORD" => "p") do
31
+ expect(subject.member_id).to eq "other_id"
32
+ expect(subject.password).to eq "other_password"
33
+ end
34
+ end
35
+
36
+ it "should raise and error if no values are set" do
37
+ env("SERMONAUDIO_MEMBER_ID" => nil, "SERMONAUDIO_PASSWORD" => nil) do
38
+ expect { subject.member_id }.to raise_error Configuration::MissingConfiguration
39
+ expect { subject.password }.to raise_error Configuration::MissingConfiguration
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
3
+ <soap12:Body>
4
+ <SubmitSermonResponse xmlns="http://www.sermonaudio.com/">
5
+ <SubmitSermonResult>Response Value</SubmitSermonResult>
6
+ </SubmitSermonResponse>
7
+ </soap12:Body>
8
+ </soap12:Envelope>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
3
+ <soap12:Body>
4
+ <UpdateSermonResponse xmlns="http://www.sermonaudio.com/" />
5
+ </soap12:Body>
6
+ </soap12:Envelope>