aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/line_referential.rb2
-rw-r--r--app/views/devise/sessions/new.html.erb16
-rw-r--r--app/views/organisations/show.html.erb3
-rw-r--r--app/views/referentials/index.html.erb16
-rw-r--r--app/views/shared/_header.erb9
-rw-r--r--app/views/users/_user.html.erb3
-rw-r--r--app/views/users/show.html.erb13
-rw-r--r--config/routes.rb2
-rw-r--r--spec/controllers/line_referentials_controller_spec.rb5
-rw-r--r--spec/features/referentials_spec.rb36
-rw-r--r--spec/features/users/user_show_spec.rb3
-rw-r--r--spec/models/line_referential_spec.rb9
12 files changed, 81 insertions, 36 deletions
diff --git a/app/models/line_referential.rb b/app/models/line_referential.rb
index e17aea456..b5ba56d7b 100644
--- a/app/models/line_referential.rb
+++ b/app/models/line_referential.rb
@@ -6,4 +6,6 @@ class LineReferential < ActiveRecord::Base
attributes = options.merge organisation: organisation
line_referential_memberships.build attributes
end
+
+ validates :name, presence: true
end
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index 2df4f3d97..4df538161 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -21,17 +21,23 @@
</div>
<div class="col-md-6 new_password">
<%= link_to t("devise.links.new_password"), new_password_path(resource_name) %>
- <% if devise_mapping.confirmable? && controller_name != 'confirmations' %>
- <br>
- <%= link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) %>
- <% end %>
+ <!-- FIXME ref #819 -->
+ <%- if false %>
+ <% if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+ <br>
+ <%= link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) %>
+ <% end %>
+ <% end %>
</div>
</div>
<% end %>
</div>
</div>
- <%= render partial: 'devise/shared/form_registration', locals: {
+ <!-- FIXME ref #819 -->
+ <%- if false %>
+ <%= render partial: 'devise/shared/form_registration', locals: {
organisation: (resource.organisation || Organisation.new) } %>
+ <% end %>
</div>
</div>
diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb
index f6c497173..3994228fd 100644
--- a/app/views/organisations/show.html.erb
+++ b/app/views/organisations/show.html.erb
@@ -48,8 +48,11 @@
<% content_for :sidebar do %>
<ul class="actions">
+<!-- FIXME ref #819 -->
+<% if false %>
<li><%= link_to t('organisations.actions.edit'), edit_organisation_path, :class => "edit" %></li>
<li><%= link_to t('users.actions.new'), new_organisation_user_path, :class => "add" %></li>
+<% end %>
<li><%= link_to t('rule_parameter_sets.actions.new'), new_organisation_rule_parameter_set_path, :class => "add" %></li>
</ul>
<% end %>
diff --git a/app/views/referentials/index.html.erb b/app/views/referentials/index.html.erb
index afd339bb0..cb84f39cc 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) %>
-<div class="referentials paginated_content">
- <%= paginated_content @referentials %>
-</div>
+<!-- FIXME #823 -->
+<% if false %>
+ <%= title_tag Referential.model_name.human(:count => 2) %>
+ <div class="referentials paginated_content">
+ <%= paginated_content @referentials %>
+ </div>
+<% end %>
<% content_for :sidebar do %>
<ul class="actions">
- <li><%= link_to t('referentials.actions.new'), new_referential_path, :class => "add" %></li>
+ <!-- FIXME #823 -->
+ <% if false %>
+ <li><%= link_to t('referentials.actions.new'), new_referential_path, :class => "add" %></li>
+ <% end %>
</ul>
<ul>
<!-- FIXME #820 -->
diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb
index 9d53d807f..ae712e48d 100644
--- a/app/views/shared/_header.erb
+++ b/app/views/shared/_header.erb
@@ -95,8 +95,13 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle user_admin" data-toggle="dropdown"><span class="gravatar"><%= user_gravatar_image_tag(current_user, 16) %></span><%= truncate(current_user.name, :length => 20) %> <b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><%= link_to t('layouts.user.profile'), edit_user_registration_path %></li>
- <li><%= link_to t('layouts.user.sign_out'), destroy_user_session_path, :method => :delete %></li>
+
+ <!-- FIXME ref #819 -->
+ <%- if false %>
+ <li><%= link_to t('layouts.user.profile'), edit_user_registration_path %></li>
+ <% end %>
+
+ <li><%= link_to t('layouts.user.sign_out'), destroy_user_session_path, :method => :delete %></li>
<li class="divider"></li>
<li><%= tab_link_to Organisation.model_name.human, organisation_path %></li>
</ul>
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
index c4b396650..7cd0cc17c 100644
--- a/app/views/users/_user.html.erb
+++ b/app/views/users/_user.html.erb
@@ -2,6 +2,8 @@
<div class="panel-heading">
<div class="panel-title clearfix">
<span class="pull-right">
+ <!-- FIXME ref #819 -->
+ <% if false %>
<% if user == current_user %>
<%= link_to( edit_user_registration_path(user), :class => "btn btn-default btn-sm" ) do %>
<span class="fa fa-pencil"></span>
@@ -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 %>
<span class="fa fa-trash-o"></span>
<% end %>
+ <% end %>
</span>
<h5>
<%= 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 @@
</p>
</div>
-<% content_for(:sidebar) do %>
- <ul class="actions">
- <li><%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %></li>
- <li><%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %></li>
- </ul>
+<!-- FIXME ref #819 -->
+<% if false %>
+ <% content_for(:sidebar) do %>
+ <ul class="actions">
+ <li><%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %></li>
+ <li><%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %></li>
+ </ul>
+ <% end %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 4c2f73826..19cb60538 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -43,7 +43,7 @@ ChouetteIhm::Application.routes.draw do
end
resources :stop_area_referentials
- resources :line_referentials
+ resources :line_referentials, :only => [:show]
resources :referentials do
resources :api_keys
diff --git a/spec/controllers/line_referentials_controller_spec.rb b/spec/controllers/line_referentials_controller_spec.rb
new file mode 100644
index 000000000..6f8356507
--- /dev/null
+++ b/spec/controllers/line_referentials_controller_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+RSpec.describe LineReferentialsController, :type => :controller do
+
+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
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
diff --git a/spec/models/line_referential_spec.rb b/spec/models/line_referential_spec.rb
new file mode 100644
index 000000000..70c005017
--- /dev/null
+++ b/spec/models/line_referential_spec.rb
@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+RSpec.describe LineReferential, :type => :model do
+ it 'should have a valid factory' do
+ expect(FactoryGirl.build(:line_referential)).to be_valid
+ end
+
+ it { should validate_presence_of(:name) }
+end