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.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +11 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +127 -0
- data/README.md +258 -0
- data/Rakefile +13 -0
- data/lib/sermonaudio/actions.rb +99 -0
- data/lib/sermonaudio/client.rb +13 -0
- data/lib/sermonaudio/configuration.rb +37 -0
- data/lib/sermonaudio/version.rb +5 -0
- data/lib/sermonaudio.rb +13 -0
- data/sermonaudio.gemspec +22 -0
- data/spec/actions_spec.rb +236 -0
- data/spec/cassettes/SermonAudio_Actions/_favorite_broadcasters/should_return_the_correct_result.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_favorite_sermons/should_return_the_correct_result.yml +509 -0
- data/spec/cassettes/SermonAudio_Actions/_favorite_speakers/should_return_the_correct_result.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_a_larger_set_of_results.yml +521 -0
- data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_a_single_result.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_get_event_types/should_return_the_correct_results.yml +513 -0
- data/spec/cassettes/SermonAudio_Actions/_get_languages/should_return_the_correct_results.yml +506 -0
- data/spec/cassettes/SermonAudio_Actions/_get_newest_series_by_member_id/should_return_the_correct_results.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_get_series_by_member_id/should_return_the_correct_results.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_get_sermon_info/should_return_the_correct_result.yml +513 -0
- data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_keyword/should_return_a_larger_set_of_results.yml +521 -0
- data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_keyword/should_return_a_single_result.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_get_speakers_by_member_id/should_return_the_correct_results.yml +508 -0
- data/spec/cassettes/SermonAudio_Actions/_newest_sermons_by_member_id/should_return_the_correct_results.yml +598 -0
- data/spec/cassettes/SermonAudio_Actions/_newest_sermons_by_speaker/should_return_the_correct_results.yml +599 -0
- data/spec/cassettes/SermonAudio_Actions/_sermon_list/should_return_a_list_of_sermons_for_the_specified_church.yml +1189 -0
- data/spec/cassettes/SermonAudio_Sermon/_find_newest_/success/should_find_newest_sermons_by_SpeakerName.yml +599 -0
- data/spec/client_spec.rb +15 -0
- data/spec/configuration_spec.rb +43 -0
- data/spec/fixtures/submit_sermon.xml +8 -0
- data/spec/fixtures/update_sermon.xml +6 -0
- data/spec/fixtures/wsdl.xml +740 -0
- data/spec/spec_helper.rb +46 -0
- metadata +134 -0
data/spec/client_spec.rb
ADDED
@@ -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>
|