Merge pull request #839 from CloCkWeRX/tweak_permissions

Tweak permissions links
This commit is contained in:
Mackenzie
2016-03-28 09:22:35 -04:00
3 changed files with 19 additions and 4 deletions

View File

@@ -11,5 +11,5 @@
- if can? :edit, @alternate_name
= link_to 'Edit', edit_alternate_name_path(@alternate_name), :class => 'btn btn-default btn-xs'
\|
\|
= link_to 'Back', alternate_names_path

View File

@@ -9,6 +9,8 @@
%b Crop:
= link_to @scientific_name.crop, @scientific_name.crop
= link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs'
\|
- if can? :edit, @scientific_name
= link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs'
\|
= link_to 'Back', scientific_names_path

View File

@@ -28,6 +28,19 @@ describe "scientific_names/show" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
rendered.should match(/Zea mays/)
rendered.should match(@scientific_name.id.to_s)
end
context 'signed in' do
before :each do
@wrangler = FactoryGirl.create(:crop_wrangling_member)
sign_in @wrangler
controller.stub(:current_user) { @wrangler }
render
end
it 'should have an edit button' do
rendered.should have_content 'Edit'
end
end
end