aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/lines_spec.rb
diff options
context:
space:
mode:
authorvlatka pavisic2016-12-02 15:10:55 +0100
committervlatka pavisic2016-12-02 15:11:48 +0100
commit47572dc97aa526dc702d7456bb7459786eb1eb0e (patch)
tree5fd79dc1ca3085bd813db37819e45e753e470c66 /spec/features/lines_spec.rb
parent2a92002b6e4a6a54af85f8144e25944043eefb0f (diff)
downloadchouette-core-47572dc97aa526dc702d7456bb7459786eb1eb0e.tar.bz2
Refs #2133 : Feature specs for referential companies, lines... and search
Diffstat (limited to 'spec/features/lines_spec.rb')
-rw-r--r--spec/features/lines_spec.rb33
1 files changed, 27 insertions, 6 deletions
diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb
index 7ff1048bf..bbb149e3c 100644
--- a/spec/features/lines_spec.rb
+++ b/spec/features/lines_spec.rb
@@ -11,19 +11,40 @@ describe "Lines", :type => :feature do
let!(:group_of_line) { create(:group_of_line) }
subject { lines.first }
- describe "list" do
- it "display lines" do
- visit line_referential_lines_path(line_referential)
+ describe "index" do
+ before(:each) { visit line_referential_lines_path(line_referential) }
+
+ it "displays lines" do
expect(page).to have_content(lines.first.name)
expect(page).to have_content(lines.last.name)
end
+ context 'fitering' do
+ it 'supports filtering by name' do
+ fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.name
+ click_button 'search-btn'
+ expect(page).to have_content(lines.first.name)
+ expect(page).not_to have_content(lines.last.name)
+ end
+
+ it 'supports filtering by number' do
+ fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.number
+ click_button 'search-btn'
+ expect(page).to have_content(lines.first.name)
+ expect(page).not_to have_content(lines.last.name)
+ end
+
+ it 'supports filtering by objectid' do
+ fill_in 'q[name_or_number_or_objectid_cont]', with: lines.first.objectid
+ click_button 'search-btn'
+ expect(page).to have_content(lines.first.name)
+ expect(page).not_to have_content(lines.last.name)
+ end
+ end
end
describe "show" do
- it "display line" do
- visit line_referential_lines_path(line_referential)
- # click_link "Voir"
+ it "displays line" do
visit line_referential_line_path(line_referential, lines.first)
expect(page).to have_content(lines.first.name)
end