test/lib/troo/actions/move_card_test.rb in troo-0.0.7 vs test/lib/troo/actions/move_card_test.rb in troo-0.0.8

- old
+ new

@@ -1,44 +1,52 @@ -require_relative "../../../test_helper" +require_relative '../../../test_helper' module Troo describe MoveCard do let(:described_class) { MoveCard } + let(:id) { '526d8e130a14a9d846001d98' } before do - @list = Fabricate(:list, external_list_id: "526d8e130a14a9d846001d98") + @list = Fabricate(:list, external_list_id: id) @card = Fabricate(:card) Troo::External::Card.stubs(:fetch).returns(true) - end + end after { database_cleanup } - describe ".initialize" do + describe '.initialize' do subject { described_class.new(@card, @list) } - it "assigns the card to an instance variable" do - subject.instance_variable_get("@card").must_equal(@card) + it 'assigns the card to an instance variable' do + subject.instance_variable_get('@card').must_equal(@card) end - it "assigns the list to an instance variable" do - subject.instance_variable_get("@list").must_equal(@list) + it 'assigns the list to an instance variable' do + subject.instance_variable_get('@list').must_equal(@list) end end - describe "#perform" do - before { VCR.insert_cassette(:move_card, decode_compressed_response: true) } - after { VCR.eject_cassette } + describe '#perform' do + before do + VCR.insert_cassette(:move_card, + decode_compressed_response: true) + end + after { VCR.eject_cassette } + subject { described_class.with(@card, @list) } - context "when the card was moved" do - it "returns a refresh of all cards for the board" do + context 'when the card was moved' do + it 'returns a refresh of all cards for the board' do subject.wont_equal false end end - context "when the card was not moved" do - before { Trello::Card.any_instance.stubs(:move_to_list).raises(Trello::Error) } + context 'when the card was not moved' do + before do + Trello::Card.any_instance.stubs(:move_to_list) + .raises(Trello::Error) + end it { subject.must_equal false } end end end