mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-19 06:15:44 -04:00
Merge pull request #839 from CloCkWeRX/tweak_permissions
Tweak permissions links
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user