<%= link_to profile.id, profile_path(profile) %> |
- <%= profile.cv %> |
<%= profile.user_id %> |
<%= profile.created_at %> |
diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb
index e10c27ff..3b40771c 100644
--- a/app/views/profiles/show.html.erb
+++ b/app/views/profiles/show.html.erb
@@ -4,8 +4,6 @@
- - <%= model_class.human_attribute_name(:cv) %>:
- - <%= @profile.cv %>
- <%= model_class.human_attribute_name(:user_id) %>:
- <%= @profile.user_id %>
- <%= model_class.human_attribute_name(:graduates_school_in) %>:
diff --git a/config/locales/de.default.yml b/config/locales/de.default.yml
index 533663a2..6b80d60f 100644
--- a/config/locales/de.default.yml
+++ b/config/locales/de.default.yml
@@ -43,6 +43,7 @@ de:
default: "%d.%m.%Y"
long: "%e. %B %Y"
short: "%e. %b"
+ datepicker: "dd.mm.yyyy"
month_names:
-
- Januar
diff --git a/config/locales/en.default.yml b/config/locales/en.default.yml
index b8b3ec95..1ab093f3 100644
--- a/config/locales/en.default.yml
+++ b/config/locales/en.default.yml
@@ -42,6 +42,7 @@ en:
default: "%Y-%m-%d"
long: "%B %d, %Y"
short: "%b %d"
+ datepicker: "yyyy-mm-dd"
month_names:
-
- January
diff --git a/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb b/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb
new file mode 100644
index 00000000..d1ca6af2
--- /dev/null
+++ b/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb
@@ -0,0 +1,6 @@
+class RemoveCVandEmailFromProfile < ActiveRecord::Migration
+ def change
+ remove_column :profiles, :cv, :string
+ remove_column :profiles, :email, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0aff5ff6..d3993502 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20161125164958) do
+ActiveRecord::Schema.define(version: 20161129121741) do
create_table "agreement_letters", force: :cascade do |t|
t.integer "user_id", null: false
@@ -57,7 +57,6 @@
end
create_table "profiles", force: :cascade do |t|
- t.string "cv"
t.integer "user_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -65,7 +64,6 @@
t.string "last_name"
t.string "gender"
t.date "birth_date"
- t.string "email"
t.string "school"
t.string "street_name"
t.string "zip_code"
diff --git a/db/seeds.rb b/db/seeds.rb
index ec71cfaf..70f21905 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -40,20 +40,50 @@
# Pupil's profile
Profile.find_or_create_by!(
- cv: "Ich habe mich zu keiner Veranstaltung beworben",
- user: pupil
+ user: pupil,
+ first_name: "Karl",
+ last_name: "Doe",
+ gender: "männlich",
+ birth_date: Date.parse('2000.11.29'),
+ school: "Schule am Griebnitzsee",
+ street_name: "Rudolf-Breitscheid-Str. 52",
+ zip_code: "14482",
+ city: "Potsdam",
+ state: "Brandenburg",
+ country: "Deutschland",
+ graduates_school_in: "2019"
)
# Teacher's profile
Profile.find_or_create_by!(
- cv: "Ich bin ein Lehrer. Ich frage Veranstaltungen für meine Schüler an.",
- user: teacher
+ user: teacher,
+ first_name: "Ernst",
+ last_name: "Teacher",
+ gender: "männlich",
+ birth_date: Date.parse('1970.1.1'),
+ school: "Schule am Griebnitzsee",
+ street_name: "Domstraße 14",
+ zip_code: "14482",
+ city: "Potsdam",
+ state: "Brandenburg",
+ country: "Deutschland",
+ graduates_school_in: "Bereits Abitur"
)
# Applicant's profile
Profile.find_or_create_by!(
- cv: "Ich bin ein Schüler, der an Veranstaltungen teilnehmen möchte.",
- user: applicant
+ user: applicant,
+ first_name: "Erika",
+ last_name: "Mustermann",
+ gender: "weiblich",
+ birth_date: Date.parse('1999.08.14'),
+ school: "Schule am Griebnitzsee",
+ street_name: "Rudolf-Breitscheid-Str. 52",
+ zip_code: "14482",
+ city: "Potsdam",
+ state: "Brandenburg",
+ country: "Deutschland",
+ graduates_school_in: "2017"
)
# Teacher's event request
diff --git a/spec/controllers/profiles_controller_spec.rb b/spec/controllers/profiles_controller_spec.rb
index 0788b83a..e06a4aa0 100644
--- a/spec/controllers/profiles_controller_spec.rb
+++ b/spec/controllers/profiles_controller_spec.rb
@@ -109,14 +109,12 @@
context "with valid params" do
let(:new_attributes) {
{
- cv: "Awesome new CV",
first_name: "Karl",
last_name: "Doe",
gender: "männlich",
birth_date: 15.years.ago,
- email: "karl@doe.com",
school: "Schule am Griebnitzsee",
- street_name: "Rudolf-Breitscheid-Str. 52",
+ street_name: "August-Bebel-Str. 88",
zip_code: "14482",
city: "Potsdam",
state: "Babelsberg",
@@ -130,7 +128,7 @@
sign_in profile.user
put :update, id: profile.to_param, profile: new_attributes, session: valid_session
profile.reload
- expect(profile.cv).to eq(new_attributes[:cv])
+ expect(profile.street_name).to eq(new_attributes[:street_name])
end
it "assigns the requested profile as @profile" do
diff --git a/spec/factories/profiles.rb b/spec/factories/profiles.rb
index 11cff916..bcb2df7b 100644
--- a/spec/factories/profiles.rb
+++ b/spec/factories/profiles.rb
@@ -3,7 +3,6 @@
# Table name: profiles
#
# id :integer not null, primary key
-# cv :string
# user_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
@@ -11,12 +10,10 @@
FactoryGirl.define do
factory :profile do
- cv "MyString"
first_name "Karl"
last_name "Doe"
gender "männlich"
birth_date 15.years.ago
- email "karl@doe.com"
school "Schule am Griebnitzsee"
street_name "Rudolf-Breitscheid-Str. 52"
zip_code "14482"
diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb
index 7096abbd..137a13a8 100644
--- a/spec/features/profile_spec.rb
+++ b/spec/features/profile_spec.rb
@@ -56,7 +56,6 @@
fill_in "profile_last_name", with: "Doe"
fill_in "profile_gender", with: "männlich"
fill_in "profile_birth_date", with: ""
- fill_in "profile_email", with: "karl@doe.com"
fill_in "profile_school", with: ""
fill_in "profile_street_name", with: "Rudolf-Breitscheid-Str. 52"
fill_in "profile_zip_code", with: "14482"
diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb
index fee74ea6..7cd8f7b3 100644
--- a/spec/models/profile_spec.rb
+++ b/spec/models/profile_spec.rb
@@ -3,7 +3,6 @@
# Table name: profiles
#
# id :integer not null, primary key
-# cv :string
# user_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
@@ -24,7 +23,7 @@
end
it "cannot create Profile without mandatory fields" do
- [:first_name, :last_name, :gender, :birth_date, :email, :school, :street_name, :zip_code, :city, :state, :country].each do |attr|
+ [:first_name, :last_name, :gender, :birth_date, :school, :street_name, :zip_code, :city, :state, :country].each do |attr|
profile = FactoryGirl.build(:profile, attr => nil)
expect(profile).to_not be_valid
end
diff --git a/spec/views/profiles/edit.html.erb_spec.rb b/spec/views/profiles/edit.html.erb_spec.rb
index 13ffb431..6bebc23b 100644
--- a/spec/views/profiles/edit.html.erb_spec.rb
+++ b/spec/views/profiles/edit.html.erb_spec.rb
@@ -9,12 +9,10 @@
render
assert_select "form[action=?][method=?]", profile_path(@profile), "post" do
- assert_select "input#profile_cv[name=?]", "profile[cv]"
assert_select "input#profile_first_name[name=?]", "profile[first_name]"
assert_select "input#profile_last_name[name=?]", "profile[last_name]"
assert_select "input#profile_gender[name=?]", "profile[gender]"
assert_select "input#profile_birth_date[name=?]", "profile[birth_date]"
- assert_select "input#profile_email[name=?]", "profile[email]"
assert_select "input#profile_school[name=?]", "profile[school]"
assert_select "input#profile_street_name[name=?]", "profile[street_name]"
assert_select "input#profile_zip_code[name=?]", "profile[zip_code]"
diff --git a/spec/views/profiles/new.html.erb_spec.rb b/spec/views/profiles/new.html.erb_spec.rb
index 16b12b17..fd8bfead 100644
--- a/spec/views/profiles/new.html.erb_spec.rb
+++ b/spec/views/profiles/new.html.erb_spec.rb
@@ -9,7 +9,7 @@
render
assert_select "form[action=?][method=?]", profiles_path, "post" do
- assert_select "input#profile_cv[name=?]", "profile[cv]"
+ assert_select "input#profile_first_name[name=?]", "profile[first_name]"
end
end
end
diff --git a/spec/views/profiles/show.html.erb_spec.rb b/spec/views/profiles/show.html.erb_spec.rb
index ee0677ca..0163dbea 100644
--- a/spec/views/profiles/show.html.erb_spec.rb
+++ b/spec/views/profiles/show.html.erb_spec.rb
@@ -7,7 +7,7 @@
it "renders attributes" do
render
- expect(rendered).to have_text(@profile.cv)
+ expect(rendered).to have_text(@profile.graduates_school_in)
end
it "renders the events table" do
|