Skip to content
Snippets Groups Projects
Commit dd7e476d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

fixed schema. removed outdated tests

parent c9d93bc8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -117,6 +117,7 @@ class Build < ActiveRecord::Base
end
 
 
# == Schema Information
#
# Table name: builds
Loading
Loading
@@ -126,9 +127,12 @@ end
# ref :string(255)
# status :string(255)
# finished_at :datetime
# trace :text
# trace :text(2147483647
# created_at :datetime not null
# updated_at :datetime not null
# sha :string(255)
# started_at :datetime
# tmp_file :string(255)
# before_sha :string(255)
#
 
Loading
Loading
@@ -141,3 +141,22 @@ end
# token :string(255)
# default_ref :string(255)
#
# == Schema Information
#
# Table name: projects
#
# id :integer(4) not null, primary key
# name :string(255) not null
# path :string(255) not null
# timeout :integer(4) default(1800), not null
# scripts :text default(""), not null
# created_at :datetime not null
# updated_at :datetime not null
# token :string(255)
# default_ref :string(255)
# gitlab_url :string(255)
# always_build :boolean(1) default(FALSE), not null
# polling_interval :integer(4)
#
Loading
Loading
@@ -28,16 +28,16 @@ ActiveRecord::Schema.define(:version => 20130114153451) do
end
 
create_table "projects", :force => true do |t|
t.string "name", :null => false
t.string "path", :null => false
t.integer "timeout", :default => 1800, :null => false
t.text "scripts", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "name", :null => false
t.string "path", :null => false
t.integer "timeout", :default => 1800, :null => false
t.text "scripts", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "token"
t.string "default_ref"
t.string "gitlab_url"
t.boolean "always_build", :default => true
t.boolean "always_build", :default => false, :null => false
t.integer "polling_interval"
end
 
Loading
Loading
Loading
Loading
@@ -18,6 +18,7 @@ describe Build do
end
 
 
# == Schema Information
#
# Table name: builds
Loading
Loading
@@ -27,9 +28,12 @@ end
# ref :string(255)
# status :string(255)
# finished_at :datetime
# trace :text
# trace :text(2147483647
# created_at :datetime not null
# updated_at :datetime not null
# sha :string(255)
# started_at :datetime
# tmp_file :string(255)
# before_sha :string(255)
#
 
Loading
Loading
@@ -22,33 +22,6 @@ describe Project do
end
end
 
describe 'after_save_with_schedule' do
it 'should not set schedule if polling_interval is blank' do
project = FactoryGirl.create :project
project.update_attribute(:polling_interval, nil)
Resque.get_schedule(project.schedule_id).should be_nil
end
it 'should set schedule if polling_interval is set' do
project = FactoryGirl.create :project
project.update_attribute(:polling_interval, '3m')
Resque.get_schedule(project.schedule_id).should.to_s == {
:class => 'SchedulerJob',
:every => project.polling_interval,
:args => [:run, project.id],
:description => project.name
}.to_s
end
it 'should cancel schedule if clear polling_interval' do
project = FactoryGirl.create :project
project.update_attribute(:polling_interval, '3m')
Resque.get_schedule(project.schedule_id).should_not be_nil
project.update_attribute(:polling_interval, nil)
Resque.get_schedule(project.schedule_id).should be_nil
end
end
it { should validate_presence_of :name }
it { should validate_presence_of :scripts }
it { should validate_presence_of :timeout }
Loading
Loading
@@ -94,3 +67,22 @@ end
# token :string(255)
# default_ref :string(255)
#
# == Schema Information
#
# Table name: projects
#
# id :integer(4) not null, primary key
# name :string(255) not null
# path :string(255) not null
# timeout :integer(4) default(1800), not null
# scripts :text default(""), not null
# created_at :datetime not null
# updated_at :datetime not null
# token :string(255)
# default_ref :string(255)
# gitlab_url :string(255)
# always_build :boolean(1) default(FALSE), not null
# polling_interval :integer(4)
#
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment