|
8 | 8 |
|
9 | 9 | # default variables and API object for all tests |
10 | 10 | let(:url) { "http://server.com" } |
11 | | - let(:salt) { "1234567890abcdefghijkl" } |
| 11 | + let(:secret) { "1234567890abcdefghijkl" } |
12 | 12 | let(:debug) { false } |
13 | | - let(:api) { BigBlueButton::BigBlueButtonApi.new(url, salt, version, debug) } |
| 13 | + let(:api) { BigBlueButton::BigBlueButtonApi.new(url, secret, version, debug) } |
14 | 14 |
|
15 | 15 | describe "#initialize" do |
16 | 16 | context "standard initialization" do |
17 | | - subject { BigBlueButton::BigBlueButtonApi.new(url, salt, version, debug) } |
| 17 | + subject { BigBlueButton::BigBlueButtonApi.new(url, secret, version, debug) } |
18 | 18 | it { subject.url.should == url } |
19 | | - it { subject.salt.should == salt } |
| 19 | + it { subject.secret.should == secret } |
20 | 20 | it { subject.version.should == version } |
21 | 21 | it { subject.debug.should == debug } |
22 | 22 | it { subject.timeout.should == 10 } |
|
28 | 28 |
|
29 | 29 | context "when the version is not informed, get it from the BBB server" do |
30 | 30 | before { BigBlueButton::BigBlueButtonApi.any_instance.should_receive(:get_api_version).and_return("0.8") } |
31 | | - subject { BigBlueButton::BigBlueButtonApi.new(url, salt, nil) } |
| 31 | + subject { BigBlueButton::BigBlueButtonApi.new(url, secret, nil) } |
32 | 32 | it { subject.version.should == "0.8" } |
33 | 33 | end |
34 | 34 |
|
35 | 35 | context "when the version informed is empty, get it from the BBB server" do |
36 | 36 | before { BigBlueButton::BigBlueButtonApi.any_instance.should_receive(:get_api_version).and_return("0.8") } |
37 | | - subject { BigBlueButton::BigBlueButtonApi.new(url, salt, " ") } |
| 37 | + subject { BigBlueButton::BigBlueButtonApi.new(url, secret, " ") } |
38 | 38 | it { subject.version.should == "0.8" } |
39 | 39 | end |
40 | 40 |
|
41 | 41 | it "when the version is lower than the lowest supported, raise exception" do |
42 | 42 | expect { |
43 | | - BigBlueButton::BigBlueButtonApi.new(url, salt, "0.1", nil) |
| 43 | + BigBlueButton::BigBlueButtonApi.new(url, secret, "0.1", nil) |
44 | 44 | }.to raise_error(BigBlueButton::BigBlueButtonException) |
45 | 45 | end |
46 | 46 |
|
47 | 47 | it "when the version is higher than thew highest supported, use the highest supported" do |
48 | | - BigBlueButton::BigBlueButtonApi.new(url, salt, "5.0", nil).version.should eql('1.0') |
| 48 | + BigBlueButton::BigBlueButtonApi.new(url, secret, "5.0", nil).version.should eql('1.0') |
49 | 49 | end |
50 | 50 |
|
51 | 51 | it "compares versions in the format 'x.xx' properly" do |
52 | 52 | expect { |
53 | 53 | # if not comparing properly, 0.61 would be bigger than 0.9, for example |
54 | 54 | # comparing the way BBB does, it is lower, so will raise an exception |
55 | | - BigBlueButton::BigBlueButtonApi.new(url, salt, "0.61", nil) |
| 55 | + BigBlueButton::BigBlueButtonApi.new(url, secret, "0.61", nil) |
56 | 56 | }.to raise_error(BigBlueButton::BigBlueButtonException) |
57 | 57 | end |
58 | 58 |
|
59 | 59 | context "current supported versions" do |
60 | 60 | before { |
61 | 61 | BigBlueButton::BigBlueButtonApi.any_instance.should_receive(:get_api_version).and_return("0.9") |
62 | 62 | } |
63 | | - subject { BigBlueButton::BigBlueButtonApi.new(url, salt) } |
| 63 | + subject { BigBlueButton::BigBlueButtonApi.new(url, secret) } |
64 | 64 | it { subject.supported_versions.should == ["0.8", "0.81", "0.9", "1.0"] } |
65 | 65 | end |
66 | 66 | end |
|
341 | 341 | end |
342 | 342 |
|
343 | 343 | describe "#==" do |
344 | | - let(:api2) { BigBlueButton::BigBlueButtonApi.new(url, salt, version, debug) } |
| 344 | + let(:api2) { BigBlueButton::BigBlueButtonApi.new(url, secret, version, debug) } |
345 | 345 |
|
346 | 346 | context "compares attributes" do |
347 | 347 | it { api.should == api2 } |
|
352 | 352 | it { api.should_not == api2 } |
353 | 353 | end |
354 | 354 |
|
355 | | - context "differs #salt" do |
356 | | - before { api2.salt = api.salt + "x" } |
| 355 | + context "differs #secret" do |
| 356 | + before { api2.secret = api.secret + "x" } |
357 | 357 | it { api.should_not == api2 } |
358 | 358 | end |
359 | 359 |
|
|
0 commit comments