mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-05 14:26:00 -04:00
converted product description to text (not string)
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
|
||||
.field
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
= f.text_field :name, :class => 'input-block-level'
|
||||
.field
|
||||
= f.label :description
|
||||
= f.text_field :description
|
||||
= f.text_area :description, :class => 'input-block-level'
|
||||
.field
|
||||
= f.label :min_price
|
||||
= f.text_field :min_price
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class ChangeProductDescriptionToText < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :products, :description, :text
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :products, :description, :string
|
||||
end
|
||||
end
|
||||
12
db/schema.rb
12
db/schema.rb
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130601011725) do
|
||||
ActiveRecord::Schema.define(:version => 20130606230333) do
|
||||
|
||||
create_table "account_types", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
@@ -206,11 +206,11 @@ ActiveRecord::Schema.define(:version => 20130601011725) do
|
||||
add_index "posts", ["slug"], :name => "index_updates_on_slug", :unique => true
|
||||
|
||||
create_table "products", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.string "description", :null => false
|
||||
t.integer "min_price", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "name", :null => false
|
||||
t.text "description", :limit => 255, :null => false
|
||||
t.integer "min_price", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "account_type_id"
|
||||
t.integer "paid_months"
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
FactoryGirl.define do
|
||||
factory :product do
|
||||
name "annual subscription"
|
||||
description "paid membership, renewing yearly"
|
||||
description "paid membership, renewing yearly, *hurrah*"
|
||||
min_price "999"
|
||||
account_type
|
||||
paid_months 12
|
||||
|
||||
@@ -15,7 +15,7 @@ describe "products/edit" do
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form", :action => products_path(@product), :method => "post" do
|
||||
assert_select "input#product_name", :name => "product[name]"
|
||||
assert_select "input#product_description", :name => "product[description]"
|
||||
assert_select "textarea#product_description", :name => "product[description]"
|
||||
assert_select "input#product_min_price", :name => "product[min_price]"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ describe "products/new" do
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form", :action => products_path, :method => "post" do
|
||||
assert_select "input#product_name", :name => "product[name]"
|
||||
assert_select "input#product_description", :name => "product[description]"
|
||||
assert_select "textarea#product_description", :name => "product[description]"
|
||||
assert_select "input#product_min_price", :name => "product[min_price]"
|
||||
assert_select "select#product_account_type_id", :name => "product[account_type_id]"
|
||||
assert_select "input#product_paid_months", :name => "product[paid_months]"
|
||||
|
||||
@@ -26,6 +26,10 @@ describe 'shop/index.html.haml', :type => "view" do
|
||||
it 'displays the order form' do
|
||||
assert_select "form", :count => 2
|
||||
end
|
||||
|
||||
it 'renders markdown in product descriptions' do
|
||||
assert_select "em", :text => 'hurrah', :count => 2
|
||||
end
|
||||
end
|
||||
|
||||
context "is paid" do
|
||||
|
||||
Reference in New Issue
Block a user