Removes column hard_deadline from call for papers
This commit is contained in:
parent
25a1c116fd
commit
c75471c0e4
7 changed files with 13 additions and 17 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
class CallForPapers < ActiveRecord::Base
|
class CallForPapers < ActiveRecord::Base
|
||||||
attr_accessible :start_date, :end_date, :hard_deadline,
|
attr_accessible :start_date, :end_date,
|
||||||
:description, :schedule_changes, :rating,
|
:description, :schedule_changes, :rating,
|
||||||
:schedule_public
|
:schedule_public
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
|
|
||||||
validates_presence_of :start_date, :end_date, :hard_deadline
|
validates_presence_of :start_date, :end_date
|
||||||
validates :rating, :numericality => { :greater_than_or_equal_to => 0, :less_than_or_equal_to => 10 }
|
validates :rating, :numericality => { :greater_than_or_equal_to => 0, :less_than_or_equal_to => 10 }
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
= semantic_form_for(@cfp, :url => admin_conference_callforpapers_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
= semantic_form_for(@cfp, :url => admin_conference_callforpapers_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
||||||
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
|
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
|
||||||
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
|
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
|
||||||
= f.input :hard_deadline, :as => :string, :input_html => { :id => "cfp-hard-datepicker", :readonly => "readonly" }
|
|
||||||
= f.input :description, :hint => "Welcome text for the Call for Papers"
|
= f.input :description, :hint => "Welcome text for the Call for Papers"
|
||||||
= f.input :schedule_changes
|
= f.input :schedule_changes
|
||||||
= f.input :schedule_public
|
= f.input :schedule_public
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
class RemoveHardDeadlineFromCallForPapers < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
remove_column :call_for_papers, :hard_deadline
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
add_column :call_for_papers, :hard_deadline, :date
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20140530082708) do
|
ActiveRecord::Schema.define(version: 20140604142949) do
|
||||||
|
|
||||||
create_table "answers", force: true do |t|
|
create_table "answers", force: true do |t|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
|
|
@ -22,7 +22,6 @@ ActiveRecord::Schema.define(version: 20140530082708) do
|
||||||
create_table "call_for_papers", force: true do |t|
|
create_table "call_for_papers", force: true do |t|
|
||||||
t.date "start_date", null: false
|
t.date "start_date", null: false
|
||||||
t.date "end_date", null: false
|
t.date "end_date", null: false
|
||||||
t.date "hard_deadline", null: false
|
|
||||||
t.text "description", null: false
|
t.text "description", null: false
|
||||||
t.integer "conference_id"
|
t.integer "conference_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ FactoryGirl.define do
|
||||||
factory :call_for_papers do
|
factory :call_for_papers do
|
||||||
start_date Date.today - 1
|
start_date Date.today - 1
|
||||||
end_date Date.today + 7
|
end_date Date.today + 7
|
||||||
hard_deadline Date.today + 8
|
|
||||||
description 'We call for papers'
|
description 'We call for papers'
|
||||||
conference
|
conference
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,13 @@ feature Conference do
|
||||||
|
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('Creating the call for papers failed. ' +
|
to eq('Creating the call for papers failed. ' +
|
||||||
"Start date can't be blank. End date can't be blank. " +
|
"Start date can't be blank. End date can't be blank.")
|
||||||
"Hard deadline can't be blank.")
|
|
||||||
|
|
||||||
today = Date.today - 1
|
today = Date.today - 1
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-end-datepicker').val('#{(today + 7).strftime('%d/%m/%Y')}')")
|
"$('#conference-end-datepicker').val('#{(today + 7).strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
|
||||||
"$('#cfp-hard-datepicker').val('#{(today + 8).strftime('%d/%m/%Y')}')")
|
|
||||||
|
|
||||||
fill_in 'call_for_papers_description', with: 'Cfp description'
|
fill_in 'call_for_papers_description', with: 'Cfp description'
|
||||||
fill_in 'call_for_papers_rating', with: '4'
|
fill_in 'call_for_papers_rating', with: '4'
|
||||||
|
|
@ -42,8 +39,6 @@ feature Conference do
|
||||||
to eq(today.strftime('%Y-%m-%d'))
|
to eq(today.strftime('%Y-%m-%d'))
|
||||||
expect(find('#conference-end-datepicker').value).
|
expect(find('#conference-end-datepicker').value).
|
||||||
to eq((today + 7).strftime('%Y-%m-%d'))
|
to eq((today + 7).strftime('%Y-%m-%d'))
|
||||||
expect(find('#cfp-hard-datepicker').value).
|
|
||||||
to eq((today + 8).strftime('%Y-%m-%d'))
|
|
||||||
expect(find('#call_for_papers_description').text).
|
expect(find('#call_for_papers_description').text).
|
||||||
to eq('Cfp description')
|
to eq('Cfp description')
|
||||||
expect(find('#call_for_papers_rating').value).to eq('4')
|
expect(find('#call_for_papers_rating').value).to eq('4')
|
||||||
|
|
@ -73,8 +68,6 @@ feature Conference do
|
||||||
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
|
"$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
|
||||||
"$('#cfp-hard-datepicker').val('#{(today + 28).strftime('%d/%m/%Y')}')")
|
|
||||||
|
|
||||||
fill_in 'call_for_papers_description', with: 'Updated description'
|
fill_in 'call_for_papers_description', with: 'Updated description'
|
||||||
fill_in 'call_for_papers_rating', with: '0'
|
fill_in 'call_for_papers_rating', with: '0'
|
||||||
|
|
@ -87,8 +80,6 @@ feature Conference do
|
||||||
to eq(today.strftime('%Y-%m-%d'))
|
to eq(today.strftime('%Y-%m-%d'))
|
||||||
expect(find('#conference-end-datepicker').value).
|
expect(find('#conference-end-datepicker').value).
|
||||||
to eq((today + 14).strftime('%Y-%m-%d'))
|
to eq((today + 14).strftime('%Y-%m-%d'))
|
||||||
expect(find('#cfp-hard-datepicker').value).
|
|
||||||
to eq((today + 28).strftime('%Y-%m-%d'))
|
|
||||||
expect(find('#call_for_papers_description').text).
|
expect(find('#call_for_papers_description').text).
|
||||||
to eq('Updated description')
|
to eq('Updated description')
|
||||||
expect(find('#call_for_papers_rating').value).to eq('0')
|
expect(find('#call_for_papers_rating').value).to eq('0')
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ describe 'admin/callforpapers/show' do
|
||||||
assign :conference, @conference
|
assign :conference, @conference
|
||||||
assign :cfp, stub_model(CallForPapers, start_date: Date.today,
|
assign :cfp, stub_model(CallForPapers, start_date: Date.today,
|
||||||
end_date: Date.today + 7.days,
|
end_date: Date.today + 7.days,
|
||||||
hard_deadline: Date.today + 6.days,
|
|
||||||
description: 'Lorem Ipsum Dolsum')
|
description: 'Lorem Ipsum Dolsum')
|
||||||
render
|
render
|
||||||
expect(rendered).to include("#{Date.today}")
|
expect(rendered).to include("#{Date.today}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue