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