Commit d04b2354 by vulehuan

rspec - product - temp

parent 78a4c073
require 'spec_helper'
describe Product do
before do
@product = Product.new(
name: "Example User",
description: "user@example.com",
headline: "foobar",
availability: "foobar",
code: '',
condition: '',
image_small: '',
image_medium: '',
review_rate: 0,
review_count: 0,
price_currency: '',
price: 0,
product_category_id: 0,
user_id: 0,
status: 1
)
end
subject { @product }
it { should respond_to(:name) }
it { should respond_to(:description) }
it { should respond_to(:headline) }
it { should respond_to(:availability) }
it { should respond_to(:code) }
it { should respond_to(:condition) }
it { should respond_to(:image_small) }
it { should respond_to(:image_medium) }
it { should respond_to(:review_rate) }
it { should respond_to(:review_count) }
it { should respond_to(:price_currency) }
it { should respond_to(:price) }
it { should respond_to(:product_category_id) }
it { should respond_to(:user_id) }
it { should respond_to(:status) }
it { should be_valid }
describe "when name is not present" do
end
describe "when name is too long" do
end
describe "when image medium is not present" do
end
describe "when price is not a number" do
end
describe "when product category is not exist" do
end
describe "when user is not exist" do
end
end
require 'spec_helper'
describe "Products Page" do
subject { page }
describe "index page" do
end
describe "product page" do
end
describe "category page" do
end
describe "detail page" do
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment