Commit 1568c214 by Truong Ba Dieu

Refactor

parent 40e5ad02
......@@ -4,10 +4,8 @@ namespace :crawler do
categories = %w(Books Music Electronics Software Kitchen)
categories.each do |search_cate|
puts '111111111111111111111111111'
category = Category.find_or_create_by(name: search_cate)
(1..5).each do |page|
puts '2222222222222222222222222222'
next if category.products.count >= 20 # limit 20 products each category
response = VacuumAwsService.item_search({
query: {
......@@ -17,7 +15,6 @@ namespace :crawler do
'ResponseGroup' => 'Medium'
}
})
puts '3333333333333333333333333333333'
items = VacuumAwsService.parse_items(response)
items.each do |item|
......
require 'spec_helper'
feature 'Visitor signs up' do
scenario 'with valid email and password' do
sign_up_with 'valid@example.com', 'password'
expect(page).to have_content('Sign out')
end
scenario 'with invalid email' do
sign_up_with 'invalid_email', 'password'
expect(page).to have_content('Sign in')
end
scenario 'with blank password' do
sign_up_with 'valid@example.com', ''
expect(page).to have_content('Sign in')
end
def sign_up_with(email, password)
visit "/users/sign_up"
fill_in 'Email', with: email
fill_in 'Password', with: password
click_button 'Sign up'
end
end
\ No newline at end of file
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