From neuromatch


sneakers-the-rat#technical-wg22-12-27 20:04:22

also need general Ruby dev stuff, like a Masto Code Structure overview, which I'm feeling more and more capable of doing, and I have been doing on my personal wiki and could export over. still need to figure out how to write tests but yes I think I have gotten the big chunks of how stuff works. the Rails <-> Redux <-> React stuff still sorta eludes me, esp how it's "supposed" to be done in the program because I have more experience with react and you can do a lot of uh web app stuff with it that could also be done with rails (tho a lot of their components are a) written in the old object style which I find sorta clumsy after converting to the function style and b) actually pretty imperative for a declarative framework, which makes stuff difficult)

sneakers-the-rat#testing23-03-18 21:48:09

@lina gathering some stuff here: Mastodon/Tests Mastodon/Tech WG Exclusive Lists Ruby Spec Ruby spec for home feed: for public feed: that gives more examples on how feeds are supposed to be filtered tag feed: in case we might want to add exclusive tag feeds (I personally do, self interested bc monsterdon lol) account filter (looks like for blocks):

and so on

the question to me is basically how these things are structured: you have some fabricator steps that set up the conditions for the test, but then you also have these `context` statements that looks like plain English strings to me? like how do those and the `describe` fields map onto the code? like is their testing system so good that you can really just write `it { be_filtered }` and that just works???? or how do you define all those.

Also u mentioned they are using a separate JavaScript testing framework? Jest ? that looks like it's configured here: and doesn't cover the glitch flavours, just the mastodon folder. it seems like that is for testing the appearance and function of the JS? not sure how it interacts with the ruby tests.

So for the sake of us learning to write tests here, I don't think we need to aim for full adversarial coverage of the feature, but just get the basics: "when an account is in an exclusive list, their posts dont show up on the home feed." judging from the other tests, it looks like we'll have to also test for boosts from them, but since it's not like a block we don't have to test a bunch of edge cases like interactions.