# /etc/init.d/postgresql start
# su - postgres
$ psql template1
-# alert user postgres with password 'xxxx';
+# alter user postgres with password 'xxxx';
# q\
$ createuser ec
Shall the new role be a superuser? (y/n) y
end
def get_search_form(actual_flg=false)
+ unless session[:admin_user].master_shop?
+ addparam = {'retailer_id' => session[:admin_user].retailer_id}
+ params[:search].merge! addparam unless params[:search].nil?
+ end
@search = SearchForm.new(params[:search])
@search, @search_list = Product.get_conditions(@search, params, actual_flg)
end
end
def search
+ add_retailer_condition
@condition = ReturnItemSearchForm.new(params[:condition])
unless @condition.valid?
render :action => :index
if params[:id].blank?
render :status => :not_found
end
- rows = ReturnItem.find(:all).map do |ri|
+ condition, join = get_csv_condition
+ rows = ReturnItem.find(:all, :conditions => flatten_conditions(condition), :joins => join).map do |ri|
a = []
a << ri.product_id
a << ri.product_style.code
private
def get_return_items
+ add_retailer_condition
@condition = ReturnItemSearchForm.new(params[:condition])
unless @condition.valid?
render :action => :index
:page => params[:page],
:per_page => @condition.per_page || 10,
:conditions => flatten_conditions(@search_list),
- :order => "id"
+ :include => [:product],
+ :order => "return_items.id"
}
@return_items = ReturnItem.paginate(find_options)
end
url_for(:action => :csv, :id => date.strftime('%Y%m%d_%H%M%S'),:format => "csv")
end
+ def add_retailer_condition
+ unless session[:admin_user].master_shop?
+ addparam = {'retailer_id' => session[:admin_user].retailer_id}
+ params[:condition].merge! addparam unless params[:condition].nil?
+ end
+ end
+
+ def get_csv_condition
+ condition = []
+ unless session[:admin_user].master_shop?
+ condition << ["products.retailer_id = ?", session[:admin_user].retailer_id]
+ return condition, "LEFT JOIN product_styles ON product_styles.id = return_items.product_style_id " + "LEFT JOIN products ON products.id = product_styles.product_id "
+ end
+ return condition, nil
+ end
+
end
+# -*- coding: utf-8 -*-
#在庫管理の親クラス
#共通ロジック
class Admin::StockBaseController < Admin::BaseController
#検索
def search
+ unless session[:admin_user].master_shop?
+ addparam = {'retailer_id' => session[:admin_user].retailer_id}
+ params[:condition].merge! addparam unless params[:condition].nil?
+ end
@condition = StockSearchForm.new(params[:condition])
unless @condition.valid?
render :action => "index"
def csv
# params[:id] はページキャッシュのキーにするだけで抽出条件にはしない
if params[:id].blank?
- render :status => :not_found
+ render :file => 'public/404.html', :status => :not_found
+ return
end
- rows = ProductStyle.find(:all).map do |ps|
+ condition, join = get_condition
+ rows = ProductStyle.find(:all, :conditions => flatten_conditions(condition), :joins => join).map do |ps|
a = []
a << ps.code
a << ps.product.name
def url_for_date(date)
url_for(:action => :csv, :id => date.strftime('%Y%m%d_%H%M%S'),:format => "csv")
- end
+ end
+
+ def get_condition
+ condition = []
+ unless session[:admin_user].master_shop?
+ condition << ["products.retailer_id = ?", session[:admin_user].retailer_id]
+ return condition, "LEFT JOIN products ON products.id = product_styles.product_id "
+ end
+ return condition, nil
+ end
end
before_filter :admin_permission_check_stock
def search
+ unless session[:admin_user].master_shop?
+ addparam = {'retailer_id' => session[:admin_user].retailer_id}
+ params[:condition].merge! addparam unless params[:condition].nil?
+ end
@condition = StockSearchForm.new(params[:condition])
unless @condition.valid?
render :action => "index"
:page => params[:page],
:per_page => @condition.per_page || 10,
:conditions => flatten_conditions(@search_list),
- :order => "id"
+ :include => [:product],
+ :order => "stock_histories.id"
}
@stock_histories = StockHistory.paginate(find_options)
end
redirect_to :action => :index, :style_id => params[:style_id]
end
+ private
+ def object
+ if params[:id]
+ style_category = StyleCategory.find_by_id(params[:id])
+ raise ActiveRecord::RecordNotFound unless style_category.style.retailer_id == session[:admin_user].retailer_id
+ elsif params[:style_category] && params[:style_category][:style_id]
+ style = Style.find(:all, :conditions => ["id = ? and retailer_id = ? ", params[:style_category][:style_id], session[:admin_user].retailer_id])
+ raise ActiveRecord::RecordNotFound if style.nil? or style == []
+ end
+ super
+ end
+
end
before_filter :admin_permission_check_standard
index.before do
- @styles = Style.find(:all, :order => "position")
- @style = Style.find_by_id(params[:id]) || Style.new
+ @styles = Style.find(:all, :conditions=>["retailer_id = ? ", session[:admin_user].retailer_id], :order => "position")
+ @style = Style.find(:last, :conditions=>["id = ? and retailer_id = ? ", params[:id], session[:admin_user].retailer_id]) || Style.new
end
new_action.wants.html do
end
action.failure.wants.html do
- @styles = Style.find(:all, :order => "position")
+ @styles = Style.find(:all, :conditions=>["retailer_id = ? ", session[:admin_user].retailer_id], :order => "position")
render :action => "index"
end
end
redirect_to :action => :index
end
+ private
+ def object
+ @object ||= Style.find(:last, :conditions => ["id = ? and retailer_id = ? ", params[:id], session[:admin_user].retailer_id])
+ end
+
end
before_filter :check_default,:only => [:edit,:confirm]
def search
+
+ if params[:condition].nil?
+ render :action => "index"
+ return
+ end
+ params[:condition].merge!({"retailer_id" => session[:admin_user].retailer_id}) unless params[:condition].nil?
@condition = SupplierSearchForm.new(params[:condition])
unless @condition.valid?
render :action => "index"
begin
@records = @agent.get_records(params)
rescue => e
- p e
+ logger.error e.message
+ e.backtrace.each{|bt|logger.error(bt)}
end
@total = @agent.total
begin
acts_as_list
belongs_to :authority
+ belongs_to :retailer
def self.validates_uniqueness_of(*attr_names)
configuration = { :message => I18n.translate("activerecord.errors.messages")[:taken], :case_sensitive => true }
validates_presence_of :authority
validates_presence_of :login_id
+
+ validates_presence_of :retailer
validates_length_of :login_id, :maximum => 15
validates_format_of :login_id, :with => /^[a-zA-Z0-9]*$/
validates_uniqueness_of :login_id
[columns, titles]
end
+ #
+ # 管理者ユーザの販売元がマスターショップであるかどうかを判定する
+ #
+ def master_shop?
+ return true if retailer_id == Retailer::DEFAULT_ID
+ return false
+ end
+
protected
def crypt_password
#1.エントリー
def self.renew_children_ids_with_command
begin
- p "batch update start..."
+ logger.info "batch update start..."
Category.transaction {
#clear all
Category.clear_children_ids
Category.childs_re_position(category)
end
}
- p "batch update end..."
+ logger.info "batch update end..."
rescue
- p "batch update error.rollback..."
+ logger.info "batch update error.rollback..."
end
end
CSV::Writer.generate(f) do | writer |\r
writer << col_names\r
customers.each do |c|\r
-# p c\r
arr = []\r
syms.each do |sym|\r
if sym == "sex".to_sym\r
has_many :delivery_fees, :dependent => :destroy, :order => :prefecture_id
has_many :payments
has_many :orders
+ belongs_to :retailer
validates_presence_of :name
+ validates_presence_of :retailer
validates_length_of :name,:url, :maximum => 50
has_many :order_details
has_one :campaign
belongs_to :supplier
+ belongs_to :retailer
validates_length_of :name , :maximum => 50
validates_length_of :name , :minimum => 1
validates_presence_of :description
validates_presence_of :introduction
validates_presence_of :supplier
+ validates_presence_of :retailer
validates_associated :sub_products
attr_accessor :small_resource_path
def supplier_name
self.supplier && self.supplier.name
end
+ def retailer_name
+ self.retailer && self.retailer.name
+ end
# 送料無料?
def free_delivery?
statuses.exists?(['name=?', '送料無料'])
unless search.sale_start_at_end.blank?
search_list << ["products.sale_start_at <= ?", search.sale_start_at_end + 1.day]
end
+ unless search.retailer_id.blank?
+ search_list << ["products.retailer_id = ?", search.retailer_id]
+ end
end
unless params["product_status_ids"].blank?
product_status = ProductStatus.find(:all, :select => "distinct product_id", :conditions => "status_id IN (#{ params["product_status_ids"].join(",") })" )
end
elsif column.to_s == "delivery_dates_label"
product.delivery_dates_label
- elsif ![:small_resource_path,:medium_resource_path,:large_resource_path,:category_name,:delivery_dates_label,:supplier_name].include?(column)&& Product.columns_hash[column.to_s].type == :datetime
+ elsif ![:small_resource_path,:medium_resource_path,:large_resource_path,:category_name,:delivery_dates_label,:supplier_name,:retailer_name].include?(column)&& Product.columns_hash[column.to_s].class == :datetime
(product[column] + (60*60*9)).strftime("%Y-%m-%d %H:%M") if product[column]
else
product[column] || product.send(column)
product.free_comment = arr[29]
setDelivery_dates(product,arr[30])
setSupplierId(product,arr[31])
+ # todo: csvupload retailer対応
+ setRetailerId(product,arr[32])
end
def setPermit(product, permit)
end
end
end
+
+ def setRetailerId(product, name)
+ if name.blank?
+ product.retailer_id = Retailer::DEFAULT_ID
+ else
+ r = Retailer.find_by_name(name)
+ if !r.blank?
+ product.retailer_id = r.id
+ else
+ raise ActiveRecord::RecordNotFound
+ end
+ end
+ end
#画像データセット
def setImageId(product,arr)
#画像IDと画像パスの項目を別々に設定して画像パスがあった場合は、その先にある画像を登録し、なかった場合は画像IDを登録する
:free_comment,
:delivery_dates_label,
:supplier_name,
+ :retailer_name,
:created_at,
:updated_at
]
:free_comment => "フリー入力",
:delivery_dates_label => "配送日",
:supplier_name => "仕入先名",
+ :retailer_name => "販売元名",
:created_at => "登録日",
:updated_at => "更新日"
}
product_access_log.save!
}
rescue TimeoutError => e
- p "err: #{ e }"
logger.info "err: #{ e }"
return false
rescue
end
return true
rescue TimeoutError => e
- p "err: #{ e }"
logger.info "err: #{ e }"
return false
rescue
--- /dev/null
+# -*- coding: undecided -*-
+class Retailer < ActiveRecord::Base
+
+ has_many :product
+ validates_presence_of :name
+
+ #DEFAULT_IDは標準の販売元として利用
+ DEFAULT_ID = 1
+
+end
unless search.returned_at_to.blank?
search_list << ["return_items.returned_at <= ?", search.returned_at_to]
end
+ unless search.retailer_id.blank?
+ search_list << ["products.retailer_id = ?", search.retailer_id]
+ end
+
end
search_list
end
unless search.moved_at_to.blank?
search_list << ["stock_histories.moved_at <= ?", search.moved_at_to]
end
+ unless search.retailer_id.blank?
+ search_list << ["products.retailer_id = ?", search.retailer_id]
+ end
end
search_list
end
class Style < ActiveRecord::Base
acts_as_paranoid
- acts_as_list
+ acts_as_list :scope => :retailer_id
has_many :style_categories, :order => 'position'
has_many :product_styles,
:class_name => "ProductStyle",
has_many :product_styles,
:class_name => "ProductStyle",
:foreign_key => "style_id2"
- validates_uniqueness_of :name, :message=>'は、既に使われています。'
- def self.select_options(id = nil)
+ belongs_to :retailer
+ validates_uniqueness_of :name, :scope => :retailer_id, :message=>'は、既に使われています。'
+ def self.select_options(id = nil, retailer_id = 1)
array = "<option value=\"\">選択して下さい</option>"
- find(:all).each{|s|
+ find(:all, :conditions => ["retailer_id = ? ", retailer_id], :order => "id").each{|s|
if s.style_categories.size > 0
array += "<option value='#{s.id}'#{ (id && id.to_s == s.id.to_s ) ? " selected=\"selected\"" : ""}>#{s.name}</otpion> "
end
end
validates_presence_of :name
+ validates_presence_of :retailer
def has_product?
style_categories.any?(&:has_product?)
DEFAULT_SUPPLIER_ID = 1
SHISYAGONYU, KIRISUTE, KIRIAGE = 0, 1, 2
TAX_RULE_NAMES = { SHISYAGONYU => "四捨五入", KIRISUTE => "切り捨て", KIRIAGE => "切り上げ"}
-
+ belongs_to :retailer
+
validates_presence_of :name
validates_uniqueness_of :name
validates_length_of :name, :maximum => 50
validates_length_of :free_comment, :maximum => 10000 , :allow_blank => true
validates_inclusion_of :tax_rule, :in => [SHISYAGONYU, KIRISUTE, KIRIAGE] , :allow_blank => true
+ validates_presence_of :retailer
+
before_update :check_default
before_destroy :check_default_and_products
raise ActiveRecord::ReadOnlyRecord
end
end
+
+ def self.list_by_retailer(retailer_id = Retailer::DEFAULT_ID)
+ return find(:all, :conditions => ["retailer_id = ? or id = ?", retailer_id, Retailer::DEFAULT_ID], :order => "id")
+ end
end
from\r
suppliers s\r
where\r
-(s.deleted_at IS NULL OR s.deleted_at > '#{Time.now.gmtime.strftime("%Y-%m-%d %H:%M:%S")}')\r
+(s.deleted_at IS NULL OR s.deleted_at > '#{Time.now.gmtime.strftime("%Y-%m-%d %H:%M:%S")}') \r
#{unless condition.supplier_id.blank?\r
conditions << condition.supplier_id.to_i\r
"and s.id = ?"\r
conditions << "%#{condition.email}%"\r
"and s.email like ? "\r
end}\r
+#{unless condition.retailer_id.blank?\r
+ conditions << condition.retailer_id.to_i\r
+ "and (s.retailer_id = ? or s.id = 1) "\r
+end}\r
order by s.id\r
EOS\r
return [sql_condition, conditions] \r
select :admin_user, :authority_id, auths, :include_blank=>true %>
</td>
</tr>
+ <tr>
+ <th>販売元 <span class="pnt">※</span></th>
+ <td>
+ <%= retailers = Retailer.find(:all, :order => :id).map {|r| [r.name, r.id]}
+ select :admin_user, :retailer_id, retailers, :include_blank=>true %>
+ </td>
+ </tr>
</table>
<div class="btn_box">
<th>権限</th>
<th>名前</th>
<th>所属</th>
+ <th>販売元</th>
<th>稼働</th>
<th>非稼働</th>
<th>編集</th>
<td><%=h authority_name(record.authority_id) %></td>
<td><%=h record.name %></td>
<td><%=h record.belongs_to %></td>
+ <td><%=h record.retailer.name %></td>
<td class="t_center"><%= radio_button_tag "activity_#{index}", "true", checked=record.activity==1, {:onclick=>"fnUpdateActivity(#{record.id}, 'true')"} %></td>
<td class="t_center"><%= radio_button_tag "activity_#{index}", "false", checked=record.activity==0, {:onclick=>"fnUpdateActivity(#{record.id}, 'false')"} %></td>
<td class="t_center"><%= link_to "編集", edit_admin_admin_user_path(record) %></td>
-<%= stylesheet_link_tag "admin_user/admin_user" %>
<%= javascript_include_tag "admin/admin_user" %>
<%= render :partial => "submenu" %>
<%if @system_supplier_use_flag%>
<tr>
<th>仕入先名<span class="pnt">※</span></th>
- <td><%suppliers = Supplier.find(:all,:order=>'id')%>
+ <td><%suppliers = Supplier.list_by_retailer(session[:admin_user].retailer_id)%>
<%= confirm_select(confirm_tag(:select, :product, :supplier_id, suppliers.map{|s| [s.name,s.id]}), @product.supplier.name, "product") %>
</td>
</tr>
<% end %>
+ <%if session[:admin_user].master_shop? %>
+ <tr>
+ <th>販売元<span class="pnt">※</span></th>
+ <td><% retailers = Retailer.find(:all,:order=>'id')%>
+ <%= confirm_select(confirm_tag(:select, :product, :retailer_id, retailers.map{|s| [s.name,s.id]}), @product.retailer.name, "product") %>
+ </td>
+ </tr>
+ <% else %>
+ <%= hidden_field_tag :retailer_id, session[:admin_user].retailer_id %>
+ <% end %>
+
<tr>
<th>カテゴリー名<span class="pnt">※</span></th>
<td>
<p><%= link_to "規格管理に戻る", admin_styles_path %></p>
<br />
<ul>
- <% Style.find(:all).each do | style | %>
+ <% Style.find(:all, :conditions=> ["retailer_id = ? ", session[:admin_user].retailer_id]).each do | style | %>
<li>
<%= style.id.to_s != params[:style_id].to_s ? link_to(h(style.name), :style_id => style.id) : h(style.name)%><br>
</li>
<th>規格名</th>
<td>
<%= f.text_field :name %>
+ <%= f.hidden_field :retailer_id, {:value => session[:admin_user].retailer_id.to_s} %>
<%= f.submit "登録", :confirm=>"この内容で登録して宜しいですか?", :class=>"btn_s" %>
</td>
</tr>
</tr>
</table>
<%= hidden_field_tag "id", params[:id] %>
+<%= hidden_field_tag "supplier[retailer_id]", session[:admin_user].retailer_id %>
mobile_device: "携帯対応端末"
input: "入力内容"
return_item: "返品情報"
+ retailer: "販売元"
attributes:
admin_user:
name: "名前"
created_at: "で作成された"
updated_at: "で更新"
deleted_at: "で削除"
+ retailer: "販売元"
authorities_function:
create_at: "で作成"
update_at: "更新時に"
created_at: "で作成された"
updated_at: "で更新"
deleted_at: "で削除"
+ retailer: "販売元名"
product_access_log:
docomo_flg: "ドコモフラグ"
send_flg: "送信フラグ"
created_at: "で作成された"
updated_at: "で更新"
deleted_at: "で削除"
+ retailer:
+ name: "販売元名"
+ created_at: "で作成された"
+ updated_at: "で更新"
+ deleted_at: "で削除"
return_item:
returned_at: "返品日時"
returned_count: "返品数"
--- /dev/null
+# -*- coding: utf-8 -*-
+class CreateRetailers < ActiveRecord::Migration
+ def self.up
+ create_table :retailers, :comment => '販売元テーブル' do |t|
+ t.column :name, :string, :comment => '販売元名称'
+ t.column :name_kana, :string, :comment => '販売元名称(カナ)'
+ t.column :corp_name, :string, :comment => '会社名'
+ t.column :corp_name_kana, :string, :comment => '会社名(カナ)'
+ t.column :deleted_at, :datetime
+ t.timestamps
+ end
+ r = Retailer.new
+ s = Shop.find(:first)
+ unless s.nil?
+ r.name = s.name
+ r.name_kana = s.name_kana
+ r.corp_name = s.corp_name
+ r.corp_name_kana = s.corp_name_kana
+ r.save
+ end
+ end
+
+ def self.down
+ drop_table :retailers
+ end
+end
--- /dev/null
+# -*- coding: utf-8 -*-
+class AddRetailerIdToManyTables < ActiveRecord::Migration
+ def self.up
+ add_column :products, :retailer_id, :integer, :default => 1, :comment => "販売元ID"
+ execute("UPDATE products SET retailer_id = 1")
+ add_column :admin_users, :retailer_id, :integer, :default => 1, :comment => "販売元ID"
+ execute("UPDATE admin_users SET retailer_id = 1")
+ add_column :delivery_traders, :retailer_id, :integer, :default => 1, :comment => "販売元ID"
+ execute("UPDATE delivery_traders SET retailer_id = 1")
+ add_column :suppliers, :retailer_id, :integer, :default => 1, :comment => "販売元ID"
+ execute("UPDATE suppliers SET retailer_id = 1")
+ add_column :styles, :retailer_id, :integer, :default => 1, :comment => "販売元ID"
+ execute("UPDATE styles SET retailer_id = 1")
+ end
+
+ def self.down
+ remove_columns :styles, :retailer_id
+ remove_columns :suppliers, :retailer_id
+ remove_columns :delivery_traders, :retailer_id
+ remove_columns :admin_users, :retailer_id
+ remove_columns :products, :retailer_id
+ end
+end
+# -*- coding: utf-8 -*-
require File.dirname(__FILE__) + '/../../spec_helper'
describe Admin::AdminUsersController do
describe "GET '新規登録'" do
before do
- @record = AdminUser.new({:name=>"gundam", :login_id=>"zak", :password=>"hyakushiki", :authority_id => 1})
+ @record = AdminUser.new({:name=>"gundam", :login_id=>"zak", :password=>"hyakushiki", :authority_id => 1, :retailer_id => 1})
end
it "登録に成功する" do
post 'create', :admin_user => @record.attributes
post 'confirm', :new_information => record
get 'update', :new_information => record
assigns[:new_information].id.should == id
- p assigns[:new_information].date.class
assigns[:new_information].date.should == DateTime.parse("2008-01-01")
response.should_not be_redirect
end
+# -*- coding: utf-8 -*-
require File.dirname(__FILE__) + '/../../spec_helper'
describe Admin::ProductsController do
fixtures :products, :admin_users, :authorities, :functions, :authorities_functions, :admin_users, :categories, :resource_datas, :image_resources
- fixtures :styles, :product_styles, :style_categories,:suppliers
+ fixtures :styles, :product_styles, :style_categories,:suppliers, :retailers
before do
session[:admin_user] = admin_users(:admin10)
get "search", :search => search
end
+ it "retailer_id" do
+ get "search", :search => {:retailer_id => @valid_product.retailer_id, :product_id => @valid_product.id.to_s}
+ end
+
after(:each) do
assigns[:products][0].should == @valid_product
end
it "confirm単体" do
resource_max = ImageResource.maximum(:id)
- post 'confirm', :product => {:small_resource => @small_pic, :medium_resource => @medium_pic, :large_resource => @large_pic, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc"}
+ post 'confirm', :product => {:small_resource => @small_pic, :medium_resource => @medium_pic, :large_resource => @large_pic, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc", :retailer_id => 1}
assigns[:product].small_resource_id.should_not be_nil
assigns[:product].small_resource_id.should > resource_max
response.should render_template("admin/products/confirm.html.erb")
it "confirm and create" do
last_product = Product.find(:last)
resource_max = ImageResource.maximum(:id)
- post 'confirm', :product => {:small_resource => @small_pic, :medium_resource => @medium_pic, :large_resource => @large_pic, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc"}
+ post 'confirm', :product => {:small_resource => @small_pic, :medium_resource => @medium_pic, :large_resource => @large_pic, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc", :retailer_id => 1}
product = assigns[:product]
- post 'create', :product => {:small_resource_id => product.small_resource_id, :medium_resource_id => product.medium_resource_id, :large_resource_id => product.large_resource_id, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc"}
+ post 'create', :product => {:small_resource_id => product.small_resource_id, :medium_resource_id => product.medium_resource_id, :large_resource_id => product.large_resource_id, :name => "test", :category_id => 1, :introduction => "test intro", :description => "test desc", :retailer_id => 1}
ImageResource.maximum(:id).should_not == resource_max
Product.find(:last).should_not == last_product
response.should redirect_to(:action => "show", :id => assigns[:product].id)
end
end
+ describe "GET 'search' from retailer_fail" do
+ before(:each) do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ @valid_product = products(:valid_product)
+ end
+
+ it "product_id" do
+ get "search", :search => {:product_id => @valid_product.id.to_s}
+ end
+
+ it "name" do
+ get "search", :search => {:name => @valid_product.name}
+ end
+
+ it "style" do
+ get "search", :search => {:style => "valid_category"}
+ end
+
+ it "code" do
+ get "search", :search => {:code => "AC001"}
+ end
+ it "code" do
+ get "search", :search => {:supplier => 2}
+ end
+ it "category" do
+ get "search", :search => {:category => @valid_product.category_id}
+ end
+
+ it "created_at" do
+ search = {}
+ search.merge! date_to_select(@valid_product.created_at, 'created_at_from')
+ search.merge! date_to_select(@valid_product.created_at, 'created_at_to')
+ get "search", :search => search
+ end
+
+ it "updated_at" do
+ search = {}
+ search.merge! date_to_select(@valid_product.updated_at, 'updated_at_from')
+ search.merge! date_to_select(@valid_product.updated_at, 'updated_at_to')
+ get "search", :search => search
+ end
+
+ it "sale_start_at" do
+ search = {}
+ search.merge! date_to_select(@valid_product.sale_start_at, 'sale_start_at_start')
+ search.merge! date_to_select(@valid_product.sale_start_at, 'sale_start_at_end')
+ get "search", :search => search
+ end
+
+ it "retailer_id" do
+ get "search", :search => {:retailer_id => @valid_product.retailer_id}
+ end
+
+ after(:each) do
+ assigns[:products].should == []
+ end
+ end
+
end
assigns[:product_styles][0].manufacturer_id.should == @ps.manufacturer_id
end
+ it "with fail_retailer" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ search = {}
+ get "search", :condition => search
+ response.should be_success
+ assigns[:product_styles].should == []
+ end
+
end
describe "GET 'new'" do
assigns[:return_items][0].product_style.manufacturer_id.should == @ri.product_style.manufacturer_id
response.should be_success
end
+
+ it "is fail_retailer" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ condition = {:name => ""}
+ get 'history_search', :condition => condition
+ assigns[:return_items].size.should == 0
+ response.should be_success
+ end
+
+
end
describe "GET 'edit'" do
get 'csv', :id => id
response.body.count("\n").should == csv_line_count
end
+
+ it "is retailer_fail" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ get 'csv', :id => DateTime.now.strftime('%Y%m%d_%H%M%S')
+ response.headers['Content-Type'].should =~ %r(^application/octet-stream)
+ rows = response.body.chomp.split("\n")
+ rows.size.should == 1
+ end
end
end
require File.dirname(__FILE__) + '/../../spec_helper'
describe Admin::ShopsController do
- fixtures :authorities, :functions, :admin_users , :shops
+ fixtures :authorities, :functions, :admin_users , :shops, :retailers
before(:each) do
session[:admin_user] = AdminUser.first
describe "GET 'delivery_create'" do
before do
- @delivery_trader = {:name=>"追加",:url=>"http://www.hoge.com"}
+ @delivery_trader = {:name=>"追加",:url=>"http://www.hoge.com", :retailer_id => Retailer::DEFAULT_ID}
@delivery_time = {}
DeliveryTime::MAX_SIZE.times do |i|
@delivery_time["#{i}"]={:name=>"午前中なら#{i}"}
DeliveryTrader.find(:first,:order=>"id desc",:limit=>1).delivery_fees.size.should == DeliveryFee::MAX_SIZE
DeliveryTrader.find(:first,:order=>"id desc",:limit=>1).delivery_fees[47].prefecture_id == nil
end
+
+ it "retailer_idが無効なものは登録できない" do
+ delivery_trader = {:name=>"追加",:url=>"http://www.hoge.com", :retailer_id => nil}
+ trader_count = DeliveryTrader.count
+ time_count = DeliveryTime.count
+ fee_count = DeliveryFee.count
+ get 'delivery_create', :delivery_trader=>delivery_trader,:delivery_time=>@delivery_time,:delivery_fee=>@delivery_fee
+ response.should render_template("admin/shops/delivery_new.html.erb")
+ end
+
+ it "存在しないretailer_idは登録できない" do
+ retailer_max = Retailer.find(:last).id + 100
+ delivery_trader = @delivery_trader.merge({:name => "fail_trader", :retailer_id => retailer_max})
+ get 'delivery_create', :delivery_trader=>delivery_trader,:delivery_time=>@delivery_time,:delivery_fee=>@delivery_fee
+ response.should render_template("admin/shops/delivery_new.html.erb")
+ end
+
+
end
+# -*- coding: utf-8 -*-
require 'spec_helper'
describe Admin::StockBaseController do
assigns[:product_styles].size.should == 1
assigns[:product_styles][0].attributes.should == product_styles(:valid_product).attributes
end
+
+ it "販売元が商品を持っていない時に検索すると空になる" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ get 'search', :condition => {}
+ assigns[:product_styles].should == []
+ end
+
+
end
end
require 'spec_helper'
describe Admin::StockCsvController do
+ fixtures :admin_users,:products,:product_styles,:suppliers
+ before do
+ session[:admin_user] = admin_users(:admin10)
+ @controller.class.skip_before_filter @controller.class.before_filter
+ @controller.class.skip_after_filter @controller.class.after_filter
+ end
#Delete this example and add some real ones
it "should use Admin::StockCsvController" do
controller.should be_an_instance_of(Admin::StockCsvController)
end
+ describe "csv" do
+ it "get csv" do
+ get 'csv', :id => "20100101"
+ response.headers['Content-Type'].should =~ %r(^application/octet-stream)
+ rows = response.body.chomp.split("\n")
+ rows.size.should >= 10
+ end
+
+ it "idが無ければ、csvは取得できない" do
+ get 'csv'
+ response.should render_template("public/404.html")
+ end
+
+ it "is retailer_fail" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ get 'csv', :id => "20100101"
+ response.headers['Content-Type'].should =~ %r(^application/octet-stream)
+ rows = response.body.chomp.split("\n")
+ rows.size.should == 1
+ end
+ end
+
end
describe Admin::StockHistoriesController do
+ fixtures :admin_users,:products,:product_styles,:suppliers, :stock_histories
+ before do
+ session[:admin_user] = admin_users(:admin10)
+ @controller.class.skip_before_filter @controller.class.before_filter
+ @controller.class.skip_after_filter @controller.class.after_filter
+ end
+
#Delete this example and add some real ones
it "should use Admin::StockHistoriesController" do
controller.should be_an_instance_of(Admin::StockHistoriesController)
end
+ describe 'get search' do
+ it "all log" do
+ get 'search', :condition => {}
+ assigns[:stock_histories].size.should > 0
+ end
+
+ it "is fail_retailer" do
+ session[:admin_user] = admin_users(:admin17_retailer_id_is_fails)
+ get 'search', :condition => {}
+ assigns[:stock_histories].size.should == 0
+ end
+ end
+
end
+# -*- coding: utf-8 -*-
require 'spec_helper'
describe Admin::StockInController do
- fixtures :admin_users,:products,:product_styles,:suppliers,:stock_histories
+ fixtures :admin_users,:products,:product_styles,:suppliers,:stock_histories, :retailers
before do
session[:admin_user] = admin_users(:admin10)
@controller.class.skip_before_filter @controller.class.before_filter
response.should render_template("admin/stock_in/edit.html.erb")
end
end
+
end
post "create", :style_category => {:style_id => 1, :name => "test"}
StyleCategory.find(:last).name.should == "test"
end
+
+ it "other shop should not be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ lambda { post "create", :style_category => {:style_id => 1, :name => "test2"} }.should raise_error(ActiveRecord::RecordNotFound)
+ StyleCategory.find(:last).name.should_not == "test2"
+ end
+
end
describe "POST 'update'" do
post "update", :id => 60, :style_category => {:style_id => 6, :name => "test"}
StyleCategory.find_by_id(60).name.should == "test"
end
+
+ it "other shop should not be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ lambda { post "update", :id => 60, :style_category => {:style_id => 6, :name => "test2"} }.should raise_error(ActiveRecord::RecordNotFound)
+ StyleCategory.find_by_id(60).name.should_not == "test2"
+ end
+
end
describe "GET 'destroy'" do
get 'destroy', :id => 60
StyleCategory.find_by_id(60).should be_nil
end
+
+ it "other shop should not be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ lambda { get 'destroy', :id => 60 }.should raise_error(ActiveRecord::RecordNotFound)
+ StyleCategory.find_by_id(60).should_not be_nil
+ end
+
end
it "should be successful" do
get 'index'
assigns[:styles].should_not be_nil
+ assigns[:styles].size.should == 7
assigns[:style].should_not be_nil
end
assigns[:style].should == Style.find_by_id(1)
end
+ it "other shop should be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ get 'index'
+ assigns[:styles].should_not be_nil
+ assigns[:styles].size.should == 1
+ end
+
+ it "other shop will not get main shop style" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ get 'index', :id => 1
+ assigns[:style].id.should be_nil
+ end
+
end
describe "GET 'new'" do
describe "create" do
it "should be successful" do
- post 'create', :style => {:name => "test"}
+ post 'create', :style => {:name => "test", :retailer_id => session[:admin_user].retailer_id}
response.should redirect_to(:action => "index")
Style.find(:last).name.should == "test"
end
+
+ it "other shop should be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ post 'create', :style => {:name => "test2", :retailer_id => session[:admin_user].retailer_id}
+ response.should redirect_to(:action => "index")
+ Style.find(:last).name.should == "test2"
+ Style.find(:last).retailer_id.should == session[:admin_user].retailer_id
+ end
+
end
describe "update" do
response.should redirect_to(:action => "index")
Style.find_by_id(1).name.should == "test"
end
+
+ it "other_user should not be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ get 'index', :id => 1
+ lambda { post "update", :id => 1, :style => {:name => "test"} }.should raise_error(NoMethodError)
+ end
+
end
describe "GET 'destroy'" do
response.should redirect_to(:action => "index")
Style.find_by_id(1).should be_nil
end
+
+ it "other_user should not be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ lambda { get 'destroy', :id => 1 }.should raise_error(NoMethodError)
+ end
+
+ it "same retailer_id should be successful" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ other_shop_style1 = styles(:other_shop_style1)
+ get 'destroy', :id => other_shop_style1.id
+ Style.find_by_id(other_shop_style1.id).should be_nil
+ end
+
+
end
describe "GET 'up'" do
Style.find_by_id(1).position.should == 1
Style.find_by_id(3).position.should == 2
end
+
+ it "should be successful" do
+ get 'up', :id => 8
+ Style.find_by_id(8).position.should == 8
+ end
+
end
describe "GET 'up'" do
Style.find_by_id(1).position.should == 3
Style.find_by_id(4).position.should == 2
end
+
+ it "should be successful" do
+ get 'down', :id => 7
+ Style.find_by_id(7).position.should == 7
+ Style.find_by_id(8).position.should == 8
+ end
+
end
require 'spec_helper'
describe Admin::SuppliersController do
- fixtures :admin_users,:suppliers,:prefectures
+ fixtures :admin_users,:suppliers,:prefectures, :retailers
before do
session[:admin_user] = admin_users(:admin10)
@controller.class.skip_before_filter @controller.class.before_filter
describe "GET 'search'" do
it "should be successful" do
- get 'search'
+ get 'search', :condition => {}
response.should be_success
+ assigns[:suppliers].size.should == 4
+ end
+
+ it "conditionがないと検索ができない" do
+ get 'search'
+ response.should render_template("admin/suppliers/index.html.erb")
end
it "仕入先ID" do
assigns[:suppliers].size.should == 1
assigns[:suppliers][0].attributes.should == suppliers(:three).attributes
end
+
+ it "違う販売元検索" do
+ not_master_shop = suppliers(:not_master_shop_1)
+ get 'search', :condition => {:name => not_master_shop.name}
+ response.should be_success
+ assigns[:suppliers].size.should == 0
+ end
+ it "違う販売元検索、admin_userが正しいケース" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ not_master_shop = suppliers(:not_master_shop_1)
+ get 'search', :condition => {:name => not_master_shop.name}
+ response.should be_success
+ assigns[:suppliers].size.should == 1
+ end
+
+ it "admin_userがメインショップじゃない場合" do
+ session[:admin_user] = admin_users(:admin18_retailer_id_is_another_shop)
+ get 'search', :condition => {}
+ response.should be_success
+ assigns[:suppliers].size.should == 2
+ end
+
end
describe "GET 'new'" do
it "成功" do
response.should_not be_redirect
response.should render_template("admin/suppliers/new.html.erb")
end
+
+ it "retailer_idが不正なパターン" do
+ retailer_max = Retailer.find(:last).id + 100
+ post 'create', :supplier => @supplier.attributes.merge({"name" => "retailer_fail", "retailer_id" => retailer_max})
+ assigns[:supplier].should_not be_nil
+ assigns[:supplier].id.should be_nil
+ response.should_not be_redirect
+ response.should render_template("admin/suppliers/new.html.erb")
+ end
+
end
describe "POST 'update'" do
password: <%= AdminUser.encode_password 'hoge' %>
authority_id: 1
activity: true
+ retailer_id: 1
load_by_admin_user_mim_position_1:
id: 2
created_at: Wed May 21 13:14:11 +0900 2008
password: <%= AdminUser.encode_password 'hoge' %>
authority_id: 1
+ retailer_id: 1
load_by_admin_user_max_position_100:
id: 3
name: max_position_100
position: 100
created_at: Wed May 22 13:14:11 +0900 2008
+ retailer_id: 1
load_by_admin_user_created_at_23:
id: 4
name: created_at_23
position: 4
created_at: Wed May 23 13:14:11 +0900 2008
+ retailer_id: 1
load_by_admin_user_created_at_24:
id: 5
position: 5
created_at: Wed May 24 13:14:11 +0900 2008
activity : true
+ retailer_id: 1
load_by_admin_user_created_at_22:
id: 6
position: 6
created_at: Wed May 22 13:14:11 +0900 2008
activity : false
+ retailer_id: 1
load_by_admin_user_activity_true:
id: 7
activity : true
authority_id: 1
password: <%= AdminUser.encode_password 'hoge' %>
+ retailer_id: 1
login_admin_user:
id: 8
created_at: Wed May 21 13:14:11 +0900 2008
activity : true
authority_id: 1
+ retailer_id: 1
load_by_admin_user_activity_false:
id: 9
login_id: admin9
password: <%= AdminUser.encode_password 'hoge' %>
authority_id: 1
+ retailer_id: 1
admin10:
id: 10
created_at: Wed May 21 13:14:11 +0900 2008
activity : true
authority_id: 1
+ retailer_id: 1
admin_user_00011:
name: "KBMJリーダー"
login_id: kbmjadmin
created_at: 2008-08-22 08:52:03.953000 Z
belongs_to: KBMJ
+ retailer_id: 1
admin_user_00012:
name: "KBMJ担当者"
login_id: kbmj
created_at: 2008-08-22 08:55:33.140000 Z
belongs_to: KBMJ
+ retailer_id: 1
admin_user_00013:
name: "KBMJ管理者"
login_id: kbmjadmin
created_at: 2008-08-22 08:56:02.453000 Z
belongs_to: KBMJ
+ retailer_id: 1
admin_user_00014:
name: "KBMJ運用者"
login_id: kbmj
created_at: 2008-08-22 08:56:29.171000 Z
belongs_to: KBMJ
+ retailer_id: 1
admin_user_00015:
name: "KBMJ顧客対応"
login_id: kbmjs
created_at: 2008-08-22 08:56:58.156000 Z
belongs_to: KBMJ
+ retailer_id: 1
admin_user_00016:
name: "KBMJ"
login_id: nitsu
created_at: 2008-08-22 08:57:28.421000 Z
belongs_to: "KBMJ"
+ retailer_id: 1
-
+admin17_retailer_id_is_fails:
+ id: 17
+ name: admin17
+ login_id: admin17
+ password: <%= AdminUser.encode_password 'hoge' %>
+ position: 17
+ created_at: Wed May 21 13:14:11 +0900 2008
+ activity : true
+ authority_id: 1
+ retailer_id: 100
+
+admin18_retailer_id_is_another_shop:
+ id: 18
+ name: admin18
+ login_id: admin18
+ password: <%= AdminUser.encode_password 'hoge' %>
+ position: 18
+ created_at: Wed May 21 13:14:11 +0900 2008
+ activity : true
+ authority_id: 1
+ retailer_id: 2
+
name: キキ
url: http://example.org/
position: 1
+ retailer_id: 1
yamato:
id: 2
name: ヤマト
url: http://example.org/
position: 2
+ retailer_id: 1
created_at: 2009-10-01 00:00:00
updated_at: 2009-10-01 00:00:00
supplier_id: 2
+ retailer_id: 1
#未公開商品 +CSVアップロード元データとして使用
not_permit_product:
id: 17
--- /dev/null
+valid_retailer:
+ id: 1
+ name: メイン販売元
+other_retailer_2:
+ id: 2
+ name: サブ販売元
style_id: 7
name: valid_category
position: 7
+
+other_shop_category1:
+ id: 80
+ style_id: 8
+ name: other_shop_category1
+ position: 8
name: valid_style
position: 7
+other_shop_style1:
+ id: 8
+ name: other_shop_style1
+ position: 8
+ retailer_id: 2
tel03: '1111'
fax01: '03'
fax02: '9999'
- fax03: '9999'
\ No newline at end of file
+ fax03: '9999'
+not_master_shop_1:
+ id: 5
+ name: 'not_master_shop_1'
+ contact_name: 'not_master_shop_1_contact'
+ zipcode01: '103'
+ zipcode02: '0003'
+ prefecture_id: 13
+ address_city: '東京都テスト区テスト町'
+ address_detail: '2-2-2'
+ tel01: '03'
+ tel02: '9998'
+ tel03: '9998'
+ fax01: '03'
+ fax02: '9998'
+ fax03: '9998'
+ retailer_id: 2
\ No newline at end of file
+# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe AdminUser do
- fixtures :admin_users, :authorities
+ fixtures :admin_users, :authorities, :retailers
before(:each) do
@admin_user = admin_users(:login_admin_user)
end
end
it "入力されたパスワードを暗号化(新規作成の場合)" do
- admin_user = AdminUser.new({:name=>"zak", :login_id=>"gundam", :password=>"zak", :authority_id => authorities(:auth01).id })
+ admin_user = AdminUser.new({:name=>"zak", :login_id=>"gundam", :password=>"zak", :authority_id => authorities(:auth01).id, :retailer_id => 1 })
admin_user.save
AdminUser.find(:first, :conditions=>["login_id=?","gundam"]).password.should == AdminUser.encode_password("zak")
end
end
end
+ describe "販売元IDを追加" do
+ it "販売元IDがないとvalidateに失敗する" do
+ @admin_user.retailer_id = nil
+ @admin_user.should_not be_valid
+ end
+
+ it "マスターショップかどうか判定" do
+ @admin_user.should be_master_shop
+ not_master_retailer = admin_users(:admin17_retailer_id_is_fails)
+ not_master_retailer.should_not be_master_shop
+ end
+ end
end
+# -*- coding: utf-8 -*-
require File.dirname(__FILE__) + '/../spec_helper'
describe Category do
- fixtures :categories, :products, :image_resources,:suppliers
+ fixtures :categories, :products, :image_resources,:suppliers, :retailers
before(:each) do
@category = categories(:dai_category)
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe DeliveryTrader do
- fixtures :delivery_traders
+ fixtures :delivery_traders, :retailers
before(:each) do
@delivery_trader = delivery_traders :witch
+# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Product do
- fixtures :products, :image_resources, :product_statuses,:categories,:product_styles,:statuses,:suppliers
+ fixtures :products, :image_resources, :product_statuses,:categories,:product_styles,:statuses,:suppliers,:retailers
include ActionView::Helpers::NumberHelper
Product.delivery_dates_select.should == arr
end
end
+
+ describe "販売元を追加" do
+ it "販売元にアクセスが可能" do
+ @product.retailer.should_not be_nil
+ end
+ end
#=====================================================
private
--- /dev/null
+# -*- coding: utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe Retailer do
+
+ describe "validateチェック" do
+ before do
+ @retailer = Retailer.new
+ end
+ it "初期状態" do
+ @retailer.should_not be_valid
+ end
+ it "販売元名称を追加" do
+ @retailer.name = "販売元テスト"
+ @retailer.should be_valid
+ end
+ end
+end
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Style do
- fixtures :styles, :style_categories,:product_styles,:products
+ fixtures :styles, :style_categories,:product_styles,:products, :retailers
before(:each) do
@style = styles(:can_incriment)
end
@style.name = styles(:can_not_incriment).name
@style.should_not be_valid
end
+ it "retailer_idのチェック" do
+ max_retailer = Retailer.find(:last).id + 100
+ @style.retailer_id = max_retailer
+ @style.should_not be_valid
+ @style.retailer_id = Retailer::DEFAULT_ID
+ @style.should be_valid
+ end
end
describe "その他" do
it "商品を持っているか判断" do
@style.has_product?.should be_true
end
end
+
+ describe "select_options" do
+ it "retailer_id = 1のケース" do
+ array = Style.select_options
+ array.size.should >= 300
+ end
+
+ it "retailer_id = 2のケース" do
+ array = Style.select_options(nil, 2)
+ array.size.should <= 300
+ end
+ end
end
require 'spec_helper'
describe Supplier do
- fixtures :suppliers
+ fixtures :suppliers, :retailers
before(:each) do
@supplier = suppliers(:one)
end
@supplier.tax_rule = 2
@supplier.should be_valid
end
+ it "販売元" do
+ @supplier.retailer_id = nil
+ @supplier.should_not be_valid
+ retailer_max = Retailer.find(:last).id + 100
+ @supplier.retailer_id = retailer_max
+ @supplier.should_not be_valid
+ @supplier.retailer_id = Retailer::DEFAULT_ID
+ @supplier.should be_valid
+ end
end
describe "その他" do
fixtures :prefectures
supplier.prefecture_name.should == prefectures(:prefecture_00011).name
end
end
-
+
+ describe "販売元一覧メソッド" do
+ fixtures :admin_users
+
+ it "引数なしの場合はDEFAILT_IDで検索" do
+ suppliers = Supplier.list_by_retailer
+ suppliers.size.should == 4
+ end
+ it "検索が正常にできる(マスターショップ)" do
+ admin_user = admin_users(:load_by_admin_user_test_id_1)
+ suppliers = Supplier.list_by_retailer(admin_user.retailer_id)
+ suppliers.size.should == 4
+ end
+
+ it "検索が正常にできる(マスター以外のショップ)" do
+ admin_user = admin_users(:admin18_retailer_id_is_another_shop)
+ suppliers = Supplier.list_by_retailer(admin_user.retailer_id)
+ suppliers.size.should == 2
+ end
+
+ end
end
-\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
-17,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,3\93ú\8cã,,,\r
-,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,\82Ä\82·\82Æ\81i\8a\94\81j,,\r
+\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8es\8fê\8eQ\8dl\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\92n,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\94Ì\94\84\8c³\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
+17,\94ñ\8cö\8aJ,\89º\92\85,,\83e\83X\83g01,\83e\83X\83g01,\83t\83@\83b\83V\83\87\83\93,5000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,japan,,,,,3\93ú\8cã,,,,\r
+,\8cö\8aJ,\83\8d\83\93\83O\83R\81[\83g,,\83e\83X\83g02,\83e\83X\83g02,\83t\83@\83b\83V\83\87\83\93,15000,18,,,18,,,,,,,,,,\91å\83J\83e\83S\83\8a,2009/10/1,,,english,,,,,,\82Ä\82·\82Æ\81i\8a\94\81j,\83\81\83C\83\93\94Ì\94\84\8c³,,\r
\8f¤\95iID,\8cö\8aJ\90Ý\92è,\96¼\91O,\8eQ\8fÆURL,\88ê\97\97\83R\83\81\83\93\83g,\8fÚ\8d×\83R\83\81\83\93\83g,\83L\81[\83\8f\81[\83h,\8eQ\8dl\8es\8fê\89¿\8ai,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9cID,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\88ê\97\97\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\89æ\91\9c\83p\83X,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9cID,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83R\83\81\83\93\83g,\8fÚ\8d×\81E\83\81\83C\83\93\8ag\91å\89æ\91\9c\83p\83X,\8dw\93ü\90§\8cÀ,\83|\83C\83\93\83g\95t\97^\97¦,\94Ì\94\84\8aJ\8en\93ú,\94Ì\94\84\8fI\97¹\93ú,\8f¤\95i\83J\83e\83S\83\8a,\93ü\89×\97\\92è\93ú,\83T\83C\83Y,\91f\8dÞ,\8c´\8eY\8d\91,\8fd\82³,\93ü\89×\93ú,\82»\82Ì\91¼\8ed\97l,\83t\83\8a\81[\93ü\97Í,\94z\91\97\93ú,\8ed\93ü\90æ\96¼,\93o\98^\93ú,\8dX\90V\93ú\r
-18,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
-,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
+18,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
+,\8cö\8aJ,\83X\83J\81[\83g,,\83e\83X\83g,\83e\83X\83g,,1000,70,,,69,,,,,,,,2009/10/1 9:00,2012/10/1 9:00,\91å\83J\83e\83S\83\8a,2009/10/1 9:00,,,,,,,,,,,2009/12/8 19:01,2009/12/8 19:01\r
--- /dev/null
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+# one:
+# column: value
+#
+# two:
+# column: value
--- /dev/null
+require 'test_helper'
+
+class RetailerTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end