Created
July 7, 2012 23:22
-
-
Save rthbound/3068539 to your computer and use it in GitHub Desktop.
spaghetti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'use_case_helper' | |
describe UseCase::Plan::Hotel::Create do | |
describe "when executed" do | |
before do | |
hotel_search_usecase_class = mock("Hotel Search UseCase Class") | |
hotel_search_usecase_object = mock("Hotel Search UseCase Object") | |
hotel_usecase_search_result = mock("Hotel Search UseCase Result") | |
hotel_usecase_search_data = mock("Hotel Search UseCase Data") | |
hotel = mock("Hotel") | |
persistence_class = mock('Persistence Class') | |
persistence_object = mock('Persistence Object') | |
# Start "find_hotel_for_plan" | |
hotel_search_usecase_class.expects(:new).returns(hotel_search_usecase_object).once | |
hotel_search_usecase_object.expects(:execute!).returns(hotel_usecase_search_result).once | |
hotel_usecase_search_result.expects(:data).returns(hotel_usecase_search_data).once | |
hotel_usecase_search_data.expects("[]").with("search").returns(hotel).once | |
# End "find_hotel_for_plan" | |
@use_case = UseCase::Plan::Hotel::Create.new(params: {hotel_id: 126913 }) | |
end | |
it "should initialize properly" do | |
@use_case.execute! | |
end | |
it "should return a UseCase::Result class" do | |
@use_case.execute!.must_be_kind_of UseCase::Result | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment