aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/line_footnotes_spec.rb
diff options
context:
space:
mode:
authorvlatka pavisic2016-12-27 12:13:53 +0100
committervlatka pavisic2016-12-27 12:13:53 +0100
commit08b68565fb7f82bc7754bd62ad3f72efca6ea62d (patch)
tree8ead4709d3ba3378f8bfb044ae05efb06914fde3 /spec/features/line_footnotes_spec.rb
parent28be322127478599c138a08e818db37fd5f3cd25 (diff)
downloadchouette-core-08b68565fb7f82bc7754bd62ad3f72efca6ea62d.tar.bz2
Refs #2260 : LinePolicy changes
Diffstat (limited to 'spec/features/line_footnotes_spec.rb')
-rw-r--r--spec/features/line_footnotes_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/line_footnotes_spec.rb b/spec/features/line_footnotes_spec.rb
new file mode 100644
index 000000000..a3eab103a
--- /dev/null
+++ b/spec/features/line_footnotes_spec.rb
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe 'Line Footnotes', type: :feature do
+ login_user
+
+ let(:referential) { Referential.first }
+ #let!(:line_referential) { create :line_referential }
+ let!(:network) { create(:network) }
+ let!(:company) { create(:company) }
+ let!(:line) { create :line_with_stop_areas, network: network, company: company, line_referential: referential.line_referential }
+ let!(:footnotes) { Array.new(2) { create :footnote, line: line } }
+ subject { footnotes.first }
+
+ describe 'index' do
+ before(:each) { visit referential_line_footnotes_path(referential.line_referential, line) }
+
+ it 'displays line footnotes' do
+ expect(page).to have_content(subject.label)
+ expect(page).to have_content(subject.label)
+ end
+
+ it 'allows R and U in CRUD' do
+ expect(page).to have_content(I18n.t('actions.edit'))
+ expect(page).not_to have_content(I18n.t('actions.show')) # they're just displayed in index view
+ expect(page).not_to have_content(I18n.t('actions.destroy'))
+ expect(page).not_to have_content(I18n.t('actions.add'))
+ end
+ end
+end