spec/integration/single_graph_spec.rb in render-0.0.1 vs spec/integration/single_graph_spec.rb in render-0.0.2

- old
+ new

@@ -23,39 +23,39 @@ it "returns structured data" do aquatic_uri = @films_endpoint.gsub(":secret_code", "secret_code=#{@secret_code}") stub_request(:get, aquatic_uri).to_return({ body: [{ id: @film_id }].to_json }) graph = Render::Graph.new(:films, { endpoint: @films_endpoint, secret_code: @secret_code }) - graph.pull.should == { films: [{ id: @film_id }] } + graph.render.should == { films: [{ id: @film_id }] } end it "returns structured data for specific resources" do id = UUID.generate aquatic_uri = @film_endpoint.gsub(":id", id).gsub(":secret_code", "secret_code=#{@secret_code}") stub_request(:get, aquatic_uri).to_return({ body: { name: @film_name }.to_json }) graph = Render::Graph.new(:film, { id: id, endpoint: @film_endpoint, secret_code: @secret_code }) - graph.pull.should == { film: { name: @film_name, year: nil } } + graph.render.should == { film: { name: @film_name, year: nil } } end end describe "stubbed responses" do before(:each) do Render.stub({ live: false }) end it "use meaningful values" do - response = Render::Graph.new(:film).pull({ name: @film_name }) + response = Render::Graph.new(:film).render({ name: @film_name }) stub_request(:post, "http://films.local/create").to_return({ body: response.to_json }) response = post_film(:anything)["film"] response["name"].should be_a(String) response["year"].should be_a(Integer) end it "allows users to specify specific values" do - response = Render::Graph.new(:film).pull({ name: @film_name }) + response = Render::Graph.new(:film).render({ name: @film_name }) data = { name: @film_name }.to_json stub_request(:post, "http://films.local/create").with({ body: data }).to_return({ body: response.to_json }) response = post_film(data)["film"]