Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added extra attributes to the tour_date model
- Loading branch information
Showing
10 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
db/migrate/20090914004607_add_more_options_for_tour_date.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class AddMoreOptionsForTourDate < ActiveRecord::Migration | ||
def self.up | ||
add_column :tour_dates, :approved, :boolean, :default => true | ||
add_column :tour_dates, :venue, :string | ||
add_column :tour_dates, :description, :text | ||
add_column :tour_dates, :tickets_link, :string | ||
end | ||
|
||
def self.down | ||
remove_column :tour_dates, :approved | ||
remove_column :tour_dates, :venue | ||
remove_column :tour_dates, :description | ||
remove_column :tour_dates, :tickets_link | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Factory.define :tour_date do |f| | ||
f.city 'Nashville' | ||
f.state 'TN' | ||
f.country 'US' | ||
f.date Date.today | ||
f.venue 'Somet Center' | ||
f.approved true | ||
f.description "this is a description of the event." | ||
f.tickets_link "http://www.ticketmaster.com" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe "TourExtensionTags" do | ||
dataset :pages | ||
|
||
describe "<r:tour_dates:each>" do | ||
|
||
before(:each) do | ||
@tour_dates = [Factory(:tour_date)] | ||
end | ||
|
||
def do_nested_tag(tag) | ||
"<r:tour_dates:each>#{tag}</r:tour_dates:each>" | ||
end | ||
|
||
it 'should render city_state_zip when <r:city_state_country> is nested' do | ||
tag = do_nested_tag("<r:city_state_country />") | ||
expected = %{Nashville, TN (US)} | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
it "should render city when <r:city> is nested" do | ||
tag = do_nested_tag("<r:city />") | ||
expected = %{Nashville} | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
it "should render state when <r:state> is nested" do | ||
tag = do_nested_tag("<r:state />") | ||
expected = "TN" | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
it "should render country when <r:country> is nested" do | ||
tag = do_nested_tag("<r:country />") | ||
expected = "US" | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
it "should render description when <r:description> is nested" do | ||
tag = do_nested_tag("<r:description />") | ||
expected = "this is a description of the event." | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
it "should render tickets link when <r:tickets_link> is nested" do | ||
tag = do_nested_tag("<r:tickets_link />") | ||
expected = "http://www.ticketmaster.com" | ||
pages(:home).should render(tag).as(expected) | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters