Skip to content

Commit

Permalink
removing schema changes and a fix to specs [#152641470]
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart-Johnson committed Nov 8, 2017
1 parent b554ed0 commit 6f15d59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20171107195635) do
ActiveRecord::Schema.define(version: 20171025145319) do

create_table "admin_rates", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" do |t|
t.integer "line_item_id"
Expand Down Expand Up @@ -488,7 +488,7 @@
t.index ["sub_service_request_id"], name: "index_payments_on_sub_service_request_id"
end

create_table "permissible_values", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
create_table "permissible_values", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" do |t|
t.string "key"
t.string "value"
t.string "concept_code"
Expand Down Expand Up @@ -810,7 +810,7 @@
t.index ["updated_at"], name: "index_sessions_on_updated_at"
end

create_table "settings", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
create_table "settings", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin" do |t|
t.string "key"
t.text "value"
t.string "data_type"
Expand Down
10 changes: 6 additions & 4 deletions spec/models/protocol/valid?_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
build_study_type_questions()
build_study_type_answers()

before :each do
Setting.find_by_key("use_indirect_cost").update_attribute(:value, true)
end

describe 'should validate funding source for projects' do
it 'should raise an exception if funding source is nil' do
project = Project.create(attributes_for(:protocol))
Expand All @@ -38,8 +42,6 @@
end
end

if Setting.find_by_key('use_indirect_cost').value
it { is_expected.to validate_numericality_of(:indirect_cost_rate).is_greater_than_or_equal_to(1) }
it { is_expected.to validate_numericality_of(:indirect_cost_rate).is_less_than_or_equal_to(1000) }
end
it { is_expected.to validate_numericality_of(:indirect_cost_rate).is_greater_than_or_equal_to(1) }
it { is_expected.to validate_numericality_of(:indirect_cost_rate).is_less_than_or_equal_to(1000) }
end

0 comments on commit 6f15d59

Please sign in to comment.