Sha256: 5bd0caa466970f127243638f64b430b502ecdfe6102f4fc6ed96380377411ccc

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Sabnzbd::Utils" do
  describe "Listing of download positions" do
    let(:sabnzbd) {Sabnzbd.new({base_uri: "localhost:8080", api_key: "valid_key"})}
    before do
      VCR.insert_cassette 'multiple slots downloading', :record => :new_episodes
    end

    it "should be able to list download positions" do
      sabnzbd.utils.slot_positions.should == {0 => "id_1", 1 => "id_2"}
    end

    after do
      VCR.eject_cassette
    end
  end


  describe "switching of download positions" do
    let(:sabnzbd) {Sabnzbd.new({base_uri: "localhost:8080", api_key: "valid_key"})}
    before do
      VCR.insert_cassette 'switch success', :record => :new_episodes
    end

    it "should be able to switch download positions" do
      first_slot = sabnzbd.slots.first 
      last_slot  = sabnzbd.slots.last
      sabnzbd.utils.switch(first_slot, last_slot)

      sabnzbd.utils.slot_positions.should == {0 => "id_2", 1 => "id_1"}
    end

    after do
      VCR.eject_cassette
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sabnzbd-0.2.0 spec/utils_spec.rb