diff options
| author | Zog | 2018-04-27 15:07:25 +0200 |
|---|---|---|
| committer | Johan Van Ryseghem | 2018-04-27 15:13:51 +0200 |
| commit | e1425294874b4cd4d71668e7669220252ea2e936 (patch) | |
| tree | 89d2877305ad5e066e47f3692b1d0b619c381eb1 /spec/views/referentials | |
| parent | 3ed5ca0e97c287977646b7af6a41632c9dd3ad49 (diff) | |
| download | chouette-core-e1425294874b4cd4d71668e7669220252ea2e936.tar.bz2 | |
Refs #6572; Fix specs
Diffstat (limited to 'spec/views/referentials')
| -rw-r--r-- | spec/views/referentials/show.html.erb_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/views/referentials/show.html.erb_spec.rb b/spec/views/referentials/show.html.erb_spec.rb index 82328cb8e..fb468d0ee 100644 --- a/spec/views/referentials/show.html.erb_spec.rb +++ b/spec/views/referentials/show.html.erb_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe "referentials/show", type: :view do - let!(:referential) do + let(:referential) do referential = create(:workbench_referential) assign :referential, referential.decorate(context: { current_organisation: referential.organisation @@ -15,6 +15,8 @@ describe "referentials/show", type: :view do let(:readonly){ false } before :each do + allow(referential.object).to receive(:referential_read_only?){ readonly } + assign :reflines, [] allow(view).to receive(:current_organisation).and_return(current_organisation) allow(view).to receive(:current_user).and_return(current_user) @@ -25,7 +27,6 @@ describe "referentials/show", type: :view do controller.request.path_parameters[:id] = referential.id allow(view).to receive(:params).and_return({action: :show}) - allow(referential).to receive(:referential_read_only?){ readonly } render template: "referentials/show", layout: "layouts/application" end @@ -41,6 +42,7 @@ describe "referentials/show", type: :view do context "with a readonly referential" do let(:readonly){ true } it "should not present edit button" do + p "HERE" expect(rendered).to_not have_selector("a[href=\"#{view.edit_referential_path(referential)}\"]") end end |
