Fixes failing tests (now you can not edit/destroy annotations unless you are their author!)

This commit is contained in:
kikito
2015-12-16 18:47:28 +01:00
parent 2c9cbb9ce6
commit 61357afba7

View File

@@ -13,7 +13,8 @@ feature 'Legislation' do
context 'Annotations', :js do
background { login_as(create :user) }
let(:user) { create(:user) }
background { login_as user }
scenario 'Create' do
legislation = create(:legislation, body: "In order to achieve...")
@@ -35,7 +36,7 @@ feature 'Legislation' do
scenario 'Update' do
legislation = create(:legislation, body: "In order to achieve...")
annotation = create(:annotation, legislation: legislation, text: "this one" , quote: "In order to achieve...", ranges: [{"start"=>"/div[2]", "startOffset"=>12, "end"=>"/div[2]", "endOffset"=>19}])
create(:annotation, user: user, legislation: legislation, text: "this one" , quote: "In order to achieve...", ranges: [{"start"=>"/div[2]", "startOffset"=>12, "end"=>"/div[2]", "endOffset"=>19}])
visit legislation_path(legislation)
@@ -56,7 +57,7 @@ feature 'Legislation' do
scenario 'Destroy' do
legislation = create(:legislation, body: "In order to achieve...")
annotation = create(:annotation, legislation: legislation, text: "this one" , quote: "achieve", ranges: [{"start"=>"/div[2]", "startOffset"=>12, "end"=>"/div[2]", "endOffset"=>19}])
annotation = create(:annotation, user: user, legislation: legislation, text: "this one" , quote: "achieve", ranges: [{"start"=>"/div[2]", "startOffset"=>12, "end"=>"/div[2]", "endOffset"=>19}])
visit legislation_path(legislation)