diff options
| -rw-r--r-- | app/models/user.rb | 3 | ||||
| -rw-r--r-- | lib/tasks/demo.rake | 9 | ||||
| -rw-r--r-- | spec/features/users/user_edit_spec.rb | 2 | ||||
| -rw-r--r-- | spec/features/users/user_index_spec.rb | 1 | ||||
| -rw-r--r-- | spec/features/users/user_show_spec.rb | 3 | ||||
| -rw-r--r-- | spec/support/devise.rb | 2 | 
6 files changed, 5 insertions, 15 deletions
| diff --git a/app/models/user.rb b/app/models/user.rb index 9e67ba743..a8772ef7b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,8 +6,7 @@ class User < ActiveRecord::Base    cattr_reader :authentication_type    devise :invitable, :registerable, :validatable, -         :recoverable, :rememberable, :trackable, -         :confirmable, :async, authentication_type +         :recoverable, :rememberable, :trackable, :async, authentication_type    # FIXME https://github.com/nbudin/devise_cas_authenticatable/issues/53    # Work around :validatable, when database_authenticatable is diabled. diff --git a/lib/tasks/demo.rake b/lib/tasks/demo.rake index fbafa96c1..d7e8c59f1 100644 --- a/lib/tasks/demo.rake +++ b/lib/tasks/demo.rake @@ -10,14 +10,13 @@ namespace :demo do      organisation = Organisation.create!(:name => "DemoChouette")      user = organisation.users.create( :name => "Demo", :email => "demo@chouette.mobi", :password => "chouette", :password_confirmation =>"chouette") -    user.confirm!      referential = organisation.referentials.create( :name => "Tatrobus", :slug => "tatrobus", :prefix => "TAT")      #resource = Rack::Test::UploadedFile.new( Rails.application.config.demo_data, 'application/zip', false)      #import_instance = ImportTask.new( :resources => resource, :referential_id => referential.id, :user_name => user.name, :no_save => false, :user_id => user.id, :name => "initialize demo", :data_format => "neptune")      #import_instance.save -	  -	 File.open("/tmp/parameters_demo.json", "w")  { |file|  + +	 File.open("/tmp/parameters_demo.json", "w")  { |file|  	                                           file.write('{  "parameters" :  {      "neptune-import": { @@ -30,10 +29,10 @@ namespace :demo do          }  	 }  }') } -	  +  	 cmd = 'curl -F "file=@'+Rails.application.config.demo_data+';filename=tatrobus.zip" -F "file=@/tmp/parameters_demo.json;filename=parameters.json" http://localhost:8180/chouette_iev/referentials/tatrobus/importer/neptune'  	 system(cmd) -	  +      puts "Restore demo environment complete"    end  end diff --git a/spec/features/users/user_edit_spec.rb b/spec/features/users/user_edit_spec.rb index c7c742416..23a58ecae 100644 --- a/spec/features/users/user_edit_spec.rb +++ b/spec/features/users/user_edit_spec.rb @@ -36,9 +36,7 @@ feature 'User edit', :devise do    #   Then I see my own 'edit profile' page    scenario "user cannot cannot edit another user's profile", :me do      me = FactoryGirl.create(:user) -    me.confirm!      other = FactoryGirl.create(:user, email: 'other@example.com') -    other.confirm!      login_as(me, :scope => :user)      visit edit_user_registration_path(other)      expect(page).to have_content 'Votre Profil' diff --git a/spec/features/users/user_index_spec.rb b/spec/features/users/user_index_spec.rb index 2f6ec4426..2a9199da3 100644 --- a/spec/features/users/user_index_spec.rb +++ b/spec/features/users/user_index_spec.rb @@ -19,7 +19,6 @@ feature 'User index page', :devise do    #   Then I see my own email address    scenario 'user sees own email address' do      user = create(:user) -    user.confirm!      login_as(user, scope: :user)      visit organisation_path      expect(page).to have_content user.name.truncate(15) diff --git a/spec/features/users/user_show_spec.rb b/spec/features/users/user_show_spec.rb index 4a56e3255..d840d752c 100644 --- a/spec/features/users/user_show_spec.rb +++ b/spec/features/users/user_show_spec.rb @@ -19,7 +19,6 @@ feature 'User profile page', :devise do    #   Then I see my own email address    scenario 'user sees own profile' do      user = FactoryGirl.create(:user) -    user.confirm!      login_as(user, :scope => :user)      visit organisation_user_path(user)      # FIXME ref #819 @@ -33,9 +32,7 @@ feature 'User profile page', :devise do    #   Then I see an 'access denied' message    scenario "user cannot see another user's profile" do      me = FactoryGirl.create(:user) -    me.confirm!      other = FactoryGirl.create(:user, email: 'other@example.com', :organisation => me.organisation) -    other.confirm!      login_as(me, :scope => :user)      Capybara.current_session.driver.header 'Referer', authenticated_root_path      visit organisation_user_path(other) diff --git a/spec/support/devise.rb b/spec/support/devise.rb index cd5782f36..d33812e6f 100644 --- a/spec/support/devise.rb +++ b/spec/support/devise.rb @@ -4,7 +4,6 @@ module DeviseRequestHelper    def login_user      organisation = Organisation.where(:name => "first").first_or_create(attributes_for(:organisation))      @user ||= create(:user, :organisation => organisation) -    @user.confirm!      login_as @user, :scope => :user      # post_via_redirect user_session_path, 'user[email]' => @user.email, 'user[password]' => @user.password    end @@ -36,7 +35,6 @@ module DeviseControllerHelper        @request.env["devise.mapping"] = Devise.mappings[:user]        organisation = Organisation.where(:name => "first").first_or_create(attributes_for(:organisation))        user = create(:user, :organisation => organisation) -      user.confirm!        sign_in user      end    end | 
