Comments (6)
Hi @atd I started wording on this enhancement
from capybara_select2.
Hi @atd , how about this syntax: expect(page).to have_select2_option 'Things to do', label: 'Things to do'
from capybara_select2.
It surely makes more sense
What about matching the array of selected options at once?
from capybara_select2.
I think that matching one option syntax will be enough. If you want to match two options you can type
expect(page).to have_select2_option 'Walk', label: 'Things to do'
expect(page).to have_select2_option 'Sleep', label: 'Things to do'
If you need to match many options you can do
['walk', 'sleep', 'go to sym'].each do |option|
expect(page).to have_select2_option option, label: 'Things to do'
end
You can add a PR with this RSpec matcher if you want
from capybara_select2.
@atd are you going to implement this feature or you want me to do it?
from capybara_select2.
Well, I have the case where the labels are added programmatically and I don't want them to be repeated.
I guess that could help, but I am not sure it will solve my case
I have already resolved it in our project in a quick dirty way, so I don't think I could summit a proper PR in the short term. So if you have the time, please go ahead! If not, I would try to get some time in the future
from capybara_select2.
Related Issues (13)
- Cannot use `select2` within modal HOT 4
- Add specific select2 helpers HOT 8
- Please clarify what selector is being used in the documentation HOT 8
- Selecting more than one select2 issue HOT 5
- undefined method `configure' for RSpec:Module HOT 3
- "Capybara::ElementNotFound" HOT 5
- Cannot select an option which happens to already be selected HOT 2
- Does Not Seems to Have Support for `within` HOT 4
- [Ruby 2.7] warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call HOT 2
- Thank You!!! HOT 3
- Select2 with tag is using a textarea for the search input rather than an input HOT 2
- Can we get a new release? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capybara_select2.