diff --git a/ruby/lib/jam_ruby/models/band.rb b/ruby/lib/jam_ruby/models/band.rb index 210753784..3a4a07f60 100644 --- a/ruby/lib/jam_ruby/models/band.rb +++ b/ruby/lib/jam_ruby/models/band.rb @@ -10,7 +10,7 @@ module JamRuby self.primary_key = 'id' before_save :stringify_photo_info , :if => :updating_photo - validates :biography, no_profanity: true, presence:true + validates :biography, no_profanity: true, presence:true, length: {maximum: 4000} validates :name, presence: true validates :country, presence: true, :unless => :skip_location_validation validates :state, presence: true, :unless => :skip_location_validation diff --git a/web/spec/features/bands_spec.rb b/web/spec/features/bands_spec.rb index 96525314e..e11a9461f 100644 --- a/web/spec/features/bands_spec.rb +++ b/web/spec/features/bands_spec.rb @@ -98,7 +98,7 @@ describe "Bands", :js => true, :type => :feature, :capybara_feature => true do end it "handles max-length field input" do - pending "update this after VRFS-1610 is resolved" + # pending "update this after VRFS-1610 is resolved" max = { name: 1024, bio: 4000, @@ -108,10 +108,14 @@ describe "Bands", :js => true, :type => :feature, :capybara_feature => true do band_name = 'a'*(max[:name] + 1) band_bio = 'b'*(max[:bio] + 1) band_website = 'c'*(max[:website] + 1) - complete_band_setup_form(band_name, band_bio, 'band-website' => band_website) - - expect(page).to have_selector('#band-profile-name', text: band_name.slice(0, max[:name])) - expect(page).to have_selector('#band-profile-biography', text: band_bio.slice(0, max[:bio])) + within('#band-setup-form') do + fill_in 'band-name', with: band_name + fill_in 'band-biography', with: band_bio + all('#band-genres input[type="checkbox"]').first.trigger(:click) + end + sleep 1 + find('#btn-band-setup-next').trigger(:click) + expect(page).to have_selector('#tdBandBiography .error-text li', text: "is too long (maximum is 4000 characters)") end it "handles special characters in text fields" do