--- /dev/null
+class BaseController < ApplicationController
+ layout 'base'
+end
--- /dev/null
+class SongsController < ApplicationController
+end
--- /dev/null
+module SongsHelper
+end
--- /dev/null
+class Song < ActiveRecord::Base
+end
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
+ map.resources :songs
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
--- /dev/null
+class CreateSongs < ActiveRecord::Migration
+ def self.up
+ create_table :songs do |t|
+ t.string :code, :limit => 5, :null => false, :default => "", :comment => "曲のコード"
+ t.string :title, :null => false, :default => "", :comment => "曲名"
+ t.text :words, :null => false, :default => "", :comment => "歌詞本体"
+ t.text :words_for_search, :null => false, :default => "", :comment => "歌詞検索用のデータ"
+ t.string :copyright, :null => false, :default => "", :comment => "楽曲の出典"
+ t.int :font_size, :null => false, :default => 4, :comment => "表示フォントサイズ"
+ t.datetime :deleted_at, :comment => "削除タイムスタンプ"
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :songs
+ end
+end
--- /dev/null
+require 'spec_helper'
+
+describe SongsController do
+
+ #Delete this example and add some real ones
+ it "should use SongsController" do
+ controller.should be_an_instance_of(SongsController)
+ end
+
+end
--- /dev/null
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+one:
+ code: MyString
+ title: MyString
+ words: MyText
+ kana: MyText
+ cright: MyString
+ font_size:
+ deleted_at: 2010-04-25 02:10:05
+
+two:
+ code: MyString
+ title: MyString
+ words: MyText
+ kana: MyText
+ cright: MyString
+ font_size:
+ deleted_at: 2010-04-25 02:10:05
--- /dev/null
+require 'spec_helper'
+
+describe SongsHelper do
+
+ #Delete this example and add some real ones or delete this file
+ it "should be included in the object returned by #helper" do
+ included_modules = (class << helper; self; end).send :included_modules
+ included_modules.should include(SongsHelper)
+ end
+
+end
--- /dev/null
+require 'spec_helper'
+
+describe Song do
+ before(:each) do
+ @valid_attributes = {
+ :code => "value for code",
+ :title => "value for title",
+ :words => "value for words",
+ :kana => "value for kana",
+ :cright => "value for cright",
+ :font_size => 1,
+ :deleted_at => Time.now
+ }
+ end
+
+ it "should create a new instance given valid attributes" do
+ Song.create!(@valid_attributes)
+ end
+end