Skip to content

Commit

Permalink
forgot alternative status, use locales for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
nstrelow committed Dec 18, 2016
1 parent f074d50 commit 3490a2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions spec/factories/application_letters.rb
Expand Up @@ -48,4 +48,8 @@
factory :application_letter_rejected, parent: :application_letter do
status :rejected
end

factory :application_letter_alternative, parent: :application_letter do
status :alternative
end
end
13 changes: 9 additions & 4 deletions spec/views/application_letters/index.html.erb_spec.rb
Expand Up @@ -6,23 +6,28 @@
it "checks if page displays accepted application" do
@application_letters = [FactoryGirl.create(:application_letter_accepted)]
render
expect(rendered).to have_content("Angenommen")
expect(rendered).to have_content(I18n.t("application_status.accepted"))
end
it "checks if page displays rejected application" do
@application_letters = [FactoryGirl.create(:application_letter_rejected)]
render
expect(rendered).to have_content("Abgelehnt")
expect(rendered).to have_content(I18n.t("application_status.rejected"))
end
it "checks if page displays pending application after deadline" do
@application_letters = [FactoryGirl.create(:application_letter)]
@application_letters[0].event.application_deadline = Date.yesterday
render
expect(rendered).to have_content("In Bearbeitung")
expect(rendered).to have_content(I18n.t("application_status.pending_after_deadline"))
end
it "checks if page displays pending application before deadline" do
@application_letters = [FactoryGirl.create(:application_letter)]
render
expect(rendered).to have_content("Beworben")
expect(rendered).to have_content(I18n.t("application_status.pending_before_deadline"))
end
it "checks if page displays alternative status application letter" do
@application_letters = [FactoryGirl.create(:application_letter_alternative)]
render
expect(rendered).to have_content(I18n.t("application_status.alternative"))
end
end

Expand Down

0 comments on commit 3490a2b

Please sign in to comment.