spec/client/template/model/instance_methods_spec.rb in mirage-3.0.0.alpha.6 vs spec/client/template/model/instance_methods_spec.rb in mirage-3.0.0.alpha.7

- old
+ new

@@ -11,28 +11,19 @@ let!(:instance) do model.new '', '' end - it 'should provide methods for customising the model' do - instance.methods.should include(:content_type, - :http_method, - :default, - :status, - :delay, - :required_parameters, - :required_body_content, - :required_headers, - :endpoint, - :id, - :url, - :requests_url, - :headers, - :value) - end context 'initialize' do + + it 'requires an endpoint' do + endpoint = 'value' + instance = model.new endpoint + instance.endpoint.should == endpoint + end + it 'requires an endpoint and value to be provided' do endpoint, value = 'endpoint', 'value' instance = model.new endpoint, value instance.endpoint.should == endpoint instance.value.should == value @@ -44,9 +35,15 @@ config.http_method='method' config.status='status' config.default=true instance = model.new 'endpoint', 'value', config + instance.content_type.should == config.content_type + instance.http_method.should == config.http_method + instance.status.should == config.status + instance.default.should == config.default + + instance = model.new 'endpoint', config instance.content_type.should == config.content_type instance.http_method.should == config.http_method instance.status.should == config.status instance.default.should == config.default end \ No newline at end of file