+
+ <% if false %>
<% if user == current_user %>
<%= link_to( edit_user_registration_path(user), :class => "btn btn-default btn-sm" ) do %>
@@ -10,6 +12,7 @@
<%= link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
<% end %>
+ <% end %>
<%= link_to( organisation_user_path(user), :class => "preview", :title => "#{User.model_name.human.capitalize} #{user.email}") do %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 94e968ca5..6e1c3d089 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -11,9 +11,12 @@
-<% content_for(:sidebar) do %>
-
- - <%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %>
- - <%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %>
-
+
+<% if false %>
+ <% content_for(:sidebar) do %>
+
+ - <%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %>
+ - <%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %>
+
+ <% end %>
<% end %>
diff --git a/spec/features/users/user_show_spec.rb b/spec/features/users/user_show_spec.rb
index a4db51497..4a56e3255 100644
--- a/spec/features/users/user_show_spec.rb
+++ b/spec/features/users/user_show_spec.rb
@@ -22,7 +22,8 @@ feature 'User profile page', :devise do
user.confirm!
login_as(user, :scope => :user)
visit organisation_user_path(user)
- expect(page).to have_content 'Mon Profil'
+ # FIXME ref #819
+ # expect(page).to have_content 'Mon Profil'
expect(page).to have_content user.email
end
--
cgit v1.2.3
From 848e6de7d25c41ee3b6cfb77740f0ce2f9eb0dd3 Mon Sep 17 00:00:00 2001
From: Xinhui
Date: Tue, 10 May 2016 15:34:30 +0200
Subject: Remove referential create link / index list
Refs #823
---
app/views/referentials/index.html.erb | 16 +++++++++++-----
spec/features/referentials_spec.rb | 36 ++++++++++++++++++-----------------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/app/views/referentials/index.html.erb b/app/views/referentials/index.html.erb
index 7f1604b7c..51088dbd3 100644
--- a/app/views/referentials/index.html.erb
+++ b/app/views/referentials/index.html.erb
@@ -1,12 +1,18 @@
-<%= title_tag Referential.model_name.human(:count => 2) %>
-
- <%= paginated_content @referentials %>
-
+
+<% if false %>
+ <%= title_tag Referential.model_name.human(:count => 2) %>
+
+ <%= paginated_content @referentials %>
+
+<% end %>
<% content_for :sidebar do %>
- - <%= link_to t('referentials.actions.new'), new_referential_path, :class => "add" %>
+
+ <% if false %>
+ - <%= link_to t('referentials.actions.new'), new_referential_path, :class => "add" %>
+ <% end %>
diff --git a/spec/features/referentials_spec.rb b/spec/features/referentials_spec.rb
index 1bce09da7..d04c53e18 100644
--- a/spec/features/referentials_spec.rb
+++ b/spec/features/referentials_spec.rb
@@ -6,33 +6,35 @@ describe "Referentials", :type => :feature do
describe "index" do
- it "should support no referential" do
- visit referentials_path
- expect(page).to have_content("Espaces de Données")
- end
+ # FIXME #823
+ # it "should support no referential" do
+ # visit referentials_path
+ # expect(page).to have_content("Espaces de Données")
+ # end
context "when several referentials exist" do
def retrieve_referential_by_slug( slug)
- @user.organisation.referentials.find_by_slug(slug) ||
+ @user.organisation.referentials.find_by_slug(slug) ||
create(:referential, :slug => slug, :name => slug, :organisation => @user.organisation)
end
-
+
let!(:referentials) { [ retrieve_referential_by_slug("aa"),
- retrieve_referential_by_slug("bb")] }
+ retrieve_referential_by_slug("bb")] }
+
+ # FIXME #823
+ # it "should show n referentials" do
+ # visit referentials_path
+ # expect(page).to have_content(referentials.first.name)
+ # expect(page).to have_content(referentials.last.name)
+ # end
- it "should show n referentials" do
- visit referentials_path
- expect(page).to have_content(referentials.first.name)
- expect(page).to have_content(referentials.last.name)
- end
-
end
end
-
+
describe "create" do
-
+
it "should" do
visit new_referential_path
fill_in "Nom", :with => "Test"
@@ -48,7 +50,7 @@ describe "Referentials", :type => :feature do
end
describe "destroy" do
- let(:referential) { create(:referential, :organisation => @user.organisation) }
+ let(:referential) { create(:referential, :organisation => @user.organisation) }
it "should remove referential" do
visit referential_path(referential)
@@ -57,5 +59,5 @@ describe "Referentials", :type => :feature do
end
end
-
+
end
--
cgit v1.2.3
From 17b85942577dd038d1ba12a9e5af775196fe4a3a Mon Sep 17 00:00:00 2001
From: Xinhui
Date: Tue, 10 May 2016 16:34:31 +0200
Subject: Add model LineReferential
Refs #824
---
app/controllers/line_referentials_controller.rb | 3 +
app/models/line_referential.rb | 4 +
app/views/line_referentials/show.html.erb | 1 +
app/views/referentials/index.html.erb | 3 +
config/routes.rb | 1 +
.../20160510134254_create_line_referentials.rb | 9 +++
db/schema.rb | 88 +++++++++++++++-------
db/seeds.rb | 1 +
.../line_referentials_controller_spec.rb | 5 ++
spec/factories/line_referentials.rb | 5 ++
spec/models/line_referential_spec.rb | 9 +++
11 files changed, 103 insertions(+), 26 deletions(-)
create mode 100644 app/controllers/line_referentials_controller.rb
create mode 100644 app/models/line_referential.rb
create mode 100644 app/views/line_referentials/show.html.erb
create mode 100644 db/migrate/20160510134254_create_line_referentials.rb
create mode 100644 spec/controllers/line_referentials_controller_spec.rb
create mode 100644 spec/factories/line_referentials.rb
create mode 100644 spec/models/line_referential_spec.rb
diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb
new file mode 100644
index 000000000..0138bb67d
--- /dev/null
+++ b/app/controllers/line_referentials_controller.rb
@@ -0,0 +1,3 @@
+class LineReferentialsController < BreadcrumbController
+ defaults :resource_class => LineReferential
+end
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb
new file mode 100644
index 000000000..e4b0fd746
--- /dev/null
+++ b/app/models/line_referential.rb
@@ -0,0 +1,4 @@
+class LineReferential < ActiveRecord::Base
+
+ validates :name, presence: true
+end
diff --git a/app/views/line_referentials/show.html.erb b/app/views/line_referentials/show.html.erb
new file mode 100644
index 000000000..023e8160c
--- /dev/null
+++ b/app/views/line_referentials/show.html.erb
@@ -0,0 +1 @@
+<%= title_tag @line_referential.name %>
diff --git a/app/views/referentials/index.html.erb b/app/views/referentials/index.html.erb
index 51088dbd3..e4847b2a4 100644
--- a/app/views/referentials/index.html.erb
+++ b/app/views/referentials/index.html.erb
@@ -7,6 +7,9 @@
<% end %>
+
+<%= link_to "Codifligne", line_referential_path(LineReferential.find_by(name: 'CodifLigne')) %>
+
<% content_for :sidebar do %>