From e4072fb395c2d32d2abe695e18fdaef16f9c571e Mon Sep 17 00:00:00 2001 From: Robert Landreaux Date: Sun, 18 Jan 2015 23:25:38 -0500 Subject: [PATCH] write 'crop_wrangling_button_spec.rb', fix previous issue --- CONTRIBUTORS.md | 2 +- .../crops/crop_wrangling_button_spec.rb | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 spec/features/crops/crop_wrangling_button_spec.rb diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bddcb3095..60a69a272 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -52,4 +52,4 @@ submit the change with your pull request. - Kevin Yang / [kevieyang](https://github.com/kevieyang) - Justin Hamman / [juzham](https://github.com/juzham) - Rocky Jaiswal / [rocky-jaiswal](https://github.com/rocky-jaiswal) - +- Robert Landreaux / [robertlandreaux](https://github.com/robertlandreaux) diff --git a/spec/features/crops/crop_wrangling_button_spec.rb b/spec/features/crops/crop_wrangling_button_spec.rb new file mode 100644 index 000000000..87c4f3f95 --- /dev/null +++ b/spec/features/crops/crop_wrangling_button_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +feature "crop wrangling button" do + + let(:crop_wrangler_member) { FactoryGirl.create(:crop_wrangler_member) } + + context "crop wrangling button" do + + background do + login_as(:crop_wrangler_member) + end + + background do + visit crops_path + end + + scenario "has a link to crop wrangling page" do + expect(page).to have_link "Wrangle Crops", wrangle_crops_path + end + + end + + let(:admin_member) { FactoryGirl.create(:admin_member) } + + context "crop wrangling button" do + + background do + login_as(:admin_member) + end + + background do + visit crops_path + end + + scenario "has a link to crop wrangling page" do + expect(page).to have_link "Wrangle Crops", wrangle_crops_path + end + + end + + let(:member) { FactoryGirl.create(:member) } + + context "crop wrangling button" do + + background do + login_as(:member) + end + + background do + visit crops_path + end + + scenario "has no link to crop wrangling page" + expect(page).to have_no_link "Wrangle Crops", wrangle_crops_path + end + end