summaryrefslogtreecommitdiff
path: root/spec/unit/request/create_spec.rb
blob: a3440af019af730e313b26f00edc0910a3b8334b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'

describe Zero::Request, '.create' do
  subject { Zero::Request.new(env) }

  context "with a fresh environment" do
    let(:env) { EnvGenerator.get('/foo') }
    it "creates an instance of Zero::Request" do
      Zero::Request.create(env).should be_an_instance_of(Zero::Request)
    end
  end

  context "with an already used environment" do
    let(:env) { EnvGenerator.get('/foo') }
    let(:new_env) { subject.env }

    it "returns an already build request" do
      Zero::Request.create(new_env).should be(subject)
    end
  end
end