* remove BPM from jam_tracks
This commit is contained in:
parent
6d839f8efa
commit
39415cdf22
|
|
@ -223,7 +223,6 @@ FactoryGirl.define do
|
|||
factory :jam_track, :class => JamRuby::JamTrack do
|
||||
sequence(:name) { |n| "jam-track-#{n}" }
|
||||
sequence(:description) { |n| "description-#{n}" }
|
||||
bpm 100.1
|
||||
time_signature '4/4'
|
||||
status 'Production'
|
||||
recording_type 'Cover'
|
||||
|
|
|
|||
|
|
@ -251,4 +251,5 @@ backing_tracks.sql
|
|||
metronome.sql
|
||||
recorded_backing_tracks.sql
|
||||
recorded_backing_tracks_add_filename.sql
|
||||
user_syncs_include_backing_tracks.sql
|
||||
user_syncs_include_backing_tracks.sql
|
||||
remove_bpm_from_jamtracks.sql
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE jam_tracks DROP COLUMN bpm;
|
||||
|
|
@ -20,7 +20,6 @@ module JamRuby
|
|||
|
||||
validates :name, presence: true, uniqueness: true, length: {maximum: 200}
|
||||
validates :description, length: {maximum: 1000}
|
||||
validates_format_of :bpm, with: /^\d+\.*\d{0,1}$/
|
||||
validates :time_signature, inclusion: {in: [nil] + TIME_SIGNATURES}
|
||||
validates :status, inclusion: {in: [nil] + STATUS}
|
||||
validates :recording_type, inclusion: {in: [nil] + RECORDING_TYPE}
|
||||
|
|
|
|||
|
|
@ -719,7 +719,6 @@ FactoryGirl.define do
|
|||
factory :jam_track, :class => JamRuby::JamTrack do
|
||||
sequence(:name) { |n| "jam-track-#{n}" }
|
||||
sequence(:description) { |n| "description-#{n}" }
|
||||
bpm 100.1
|
||||
time_signature '4/4'
|
||||
status 'Production'
|
||||
recording_type 'Cover'
|
||||
|
|
|
|||
|
|
@ -55,25 +55,6 @@ describe JamTrack do
|
|||
end
|
||||
|
||||
describe "validations" do
|
||||
describe "bpm" do
|
||||
it "1" do
|
||||
FactoryGirl.build(:jam_track, bpm: 1).valid?.should be_true
|
||||
end
|
||||
|
||||
it "100" do
|
||||
FactoryGirl.build(:jam_track, bpm: 100).valid?.should be_true
|
||||
end
|
||||
|
||||
it "100.1" do
|
||||
FactoryGirl.build(:jam_track, bpm: 100.1).valid?.should be_true
|
||||
end
|
||||
|
||||
it "100.12" do
|
||||
jam_track = FactoryGirl.build(:jam_track, bpm: 100.12)
|
||||
jam_track.valid?.should be_false
|
||||
jam_track.errors[:bpm].should == ['is invalid']
|
||||
end
|
||||
end
|
||||
|
||||
describe "price" do
|
||||
|
||||
|
|
|
|||
|
|
@ -711,7 +711,6 @@ FactoryGirl.define do
|
|||
factory :jam_track, :class => JamRuby::JamTrack do
|
||||
sequence(:name) { |n| "jam-track-#{n}" }
|
||||
sequence(:description) { |n| "description-#{n}" }
|
||||
bpm 100.1
|
||||
time_signature '4/4'
|
||||
status 'Production'
|
||||
recording_type 'Cover'
|
||||
|
|
|
|||
Loading…
Reference in New Issue